feat: harden Bunny upload flow, migrate Bunny playback to hls.js, and add Bunny storage admin stats

This commit is contained in:
Yusuf İpek
2026-02-22 13:03:45 +03:00
parent 10164069dd
commit e30b4a5b19
17 changed files with 1445 additions and 285 deletions
+4 -5
View File
@@ -55,9 +55,10 @@ interface VideoCardProps {
lastUpdated: string;
};
projectId: string;
onDeleted?: (videoId: string) => void;
}
export function VideoCard({ video, projectId }: VideoCardProps) {
export function VideoCard({ video, projectId, onDeleted }: VideoCardProps) {
const router = useRouter();
const [imgError, setImgError] = useState(false);
const [retryKey, setRetryKey] = useState(0);
@@ -165,8 +166,7 @@ export function VideoCard({ video, projectId }: VideoCardProps) {
});
if (res.ok) {
setShowDeleteDialog(false);
// Give revalidatePath time to invalidate cache before refreshing
await new Promise((r) => setTimeout(r, 300));
onDeleted?.(video.id);
router.refresh();
}
} catch (err) {
@@ -193,8 +193,7 @@ export function VideoCard({ video, projectId }: VideoCardProps) {
src={`${video.thumbnailUrl?.replace('vz-thumbnail.b-cdn.net', 'vz-965f4f4a-fc1.b-cdn.net')}${retryKey ? `?t=${retryKey}` : ''}`}
alt={video.title}
className="absolute inset-0 w-full h-full object-cover transition-transform group-hover:scale-105"
onError={(e) => {
console.error('Thumbnail failed to load. Tried:', (e.target as HTMLImageElement).currentSrc);
onError={() => {
setImgError(true);
// Check again after 10 seconds in case Bunny is still processing
setTimeout(() => {