mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-12 01:46:08 +00:00
chore: clean up lint/type issues and tighten comment media URL validation
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { VideoProvider, VideoMetadata, EmbedOptions, ThumbnailSize } from './types';
|
||||
import type { VideoProvider, VideoMetadata, EmbedOptions } from './types';
|
||||
import { getCachedMetadata, setCachedMetadata } from './metadata-cache';
|
||||
|
||||
// Bunny Stream URL patterns
|
||||
@@ -43,8 +43,7 @@ export const bunnyProvider: VideoProvider = {
|
||||
return `https://iframe.mediadelivery.net/embed/${libraryId}/${videoId}?${params.toString()}`;
|
||||
},
|
||||
|
||||
getThumbnailUrl(videoId: string, size: ThumbnailSize = 'medium'): string {
|
||||
const libraryId = process.env.NEXT_PUBLIC_BUNNY_STREAM_LIBRARY_ID || process.env.BUNNY_STREAM_LIBRARY_ID || '0';
|
||||
getThumbnailUrl(videoId: string): string {
|
||||
// Bunny stream thumbnails: https://vz-uuid.b-cdn.net/{videoId}/thumbnail.jpg
|
||||
// Since we don't have the b-cdn pull zone readily available in pure abstract,
|
||||
// we should rely on fetching metadata for actual thumbnails, OR construct via API
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { VideoProvider, VideoMetadata, EmbedOptions, ThumbnailSize } from './types';
|
||||
import type { VideoProvider, VideoMetadata, EmbedOptions } from './types';
|
||||
|
||||
// Direct video URL patterns (for future self-hosted videos)
|
||||
const DIRECT_VIDEO_PATTERNS = [
|
||||
@@ -49,7 +49,8 @@ export const directProvider: VideoProvider = {
|
||||
return `${videoId}${queryString ? `#t=${options.startTime}` : ''}`;
|
||||
},
|
||||
|
||||
getThumbnailUrl(videoId: string, size: ThumbnailSize = 'medium'): string {
|
||||
getThumbnailUrl(videoId: string): string {
|
||||
void videoId;
|
||||
// For direct uploads, thumbnail would be generated server-side
|
||||
// Return a placeholder for now
|
||||
return '/placeholder-video-thumbnail.png';
|
||||
|
||||
@@ -84,7 +84,7 @@ export const youtubeProvider: VideoProvider = {
|
||||
|
||||
setCachedMetadata(cacheKey, metadata);
|
||||
return metadata;
|
||||
} catch (error) {
|
||||
} catch {
|
||||
// Fallback with minimal data
|
||||
const fallback: VideoMetadata = {
|
||||
title: 'YouTube Video',
|
||||
|
||||
Reference in New Issue
Block a user