From 6a1ff3afa6fca57ddc72aab474f277f2ab4e11d2 Mon Sep 17 00:00:00 2001 From: shiyu Date: Wed, 17 Dec 2025 09:59:48 +0800 Subject: [PATCH] feat(VideoLibrary): enhance cover rendering and loading skeletons --- web/src/apps/VideoPlayer/VideoLibrary.tsx | 121 +++++++++++++++------- 1 file changed, 85 insertions(+), 36 deletions(-) diff --git a/web/src/apps/VideoPlayer/VideoLibrary.tsx b/web/src/apps/VideoPlayer/VideoLibrary.tsx index 2c6e698..f69bd98 100644 --- a/web/src/apps/VideoPlayer/VideoLibrary.tsx +++ b/web/src/apps/VideoPlayer/VideoLibrary.tsx @@ -141,43 +141,88 @@ export const VideoLibraryApp: React.FC = () => { const renderCover = (item: VideoLibraryItem) => { const label = item.type === 'tv' ? 'TV' : 'Movie'; - const subtitle = item.type === 'tv' - ? `${item.seasons_count || 0} ${t('Seasons')} ยท ${item.episodes_count || 0} ${t('Episodes')}` - : (item.year ? String(item.year) : ''); + const coverUrl = tmdbImage(item.poster_path, 'w342') || tmdbImage(item.backdrop_path, 'w780'); return (
-
+ {coverUrl ? ( + {item.title + ) : ( +
+ +
+ )} + +
+ +
{label} - +
-
- -
- - {item.title || '--'} - - {subtitle && ( - - {subtitle} - - )} -
+ +
+
); @@ -543,14 +588,18 @@ export const VideoLibraryApp: React.FC = () => { {loading ? (
{Array.from({ length: 10 }).map((_, idx) => ( - } - > - - + + +
+ )} + > + + ))}
) : filtered.length === 0 ? ( @@ -604,7 +653,7 @@ export const VideoLibraryApp: React.FC = () => { title={detailTitle || selected?.title || t('Details')} open={detailOpen} onClose={closeDetail} - width={900} + width="100%" destroyOnHidden getContainer={false} styles={{ body: { padding: 0 } }}