Skip to content

Commit bcc36b8

Browse files
authored
fix(home): resolve missing thumbnails for music videos and videos (#490)
Recently downloaded music videos and videos do not extract Thumb artwork on the Jellyfin server by default anymore. On home screen rows using ImageType.thumb (such as Continue Watching or plugin-generated sections), they would fall back to parent artist/folder backdrop or thumbnail, or render completely blank cards if those were missing. This commit updates _resolveRowImageUrl and _resolveLandscapeImageUrl in home_screen.dart to: 1. Fall back to the item's own Primary image for MusicVideo and Video types when Thumb artwork is missing, instead of falling back to parent backdrop/thumbnail. 2. Skip the parent backdrop image fallback logic for MusicVideo and Video types, ensuring their own Primary image takes precedence. This aligns home screen resolving logic with the library browse screen. Closes #271 Co-authored-by: mattsigal <mattsigal@users.noreply.github.com>
1 parent 3bca7d8 commit bcc36b8

1 file changed

Lines changed: 15 additions & 13 deletions

File tree

lib/ui/screens/home/home_screen.dart

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3618,14 +3618,16 @@ class _ContentRowsState extends State<_ContentRows>
36183618
tag: item.backdropImageTags.first,
36193619
);
36203620
}
3621-
final parentId = item.parentBackdropItemId;
3622-
final parentTags = item.parentBackdropImageTags;
3623-
if (parentId != null && parentTags.isNotEmpty) {
3624-
return imageApi.getBackdropImageUrl(
3625-
parentId,
3626-
maxWidth: maxW,
3627-
tag: parentTags.first,
3628-
);
3621+
if (item.type != 'Video' && item.type != 'MusicVideo') {
3622+
final parentId = item.parentBackdropItemId;
3623+
final parentTags = item.parentBackdropImageTags;
3624+
if (parentId != null && parentTags.isNotEmpty) {
3625+
return imageApi.getBackdropImageUrl(
3626+
parentId,
3627+
maxWidth: maxW,
3628+
tag: parentTags.first,
3629+
);
3630+
}
36293631
}
36303632
return _resolvePrimaryImageUrl(item, imageApi, maxWidth: maxW);
36313633
}
@@ -3845,16 +3847,16 @@ class _ContentRowsState extends State<_ContentRows>
38453847
if (imageType == ImageType.thumb) {
38463848
final maxW = (height * 16 / 9 * requestScale).toInt();
38473849
final maxH = (height * requestScale).toInt();
3848-
if (!useSeriesThumbs) {
3849-
if (item.type == 'Episode') {
3850-
final episodePrimary = _resolvePrimaryImageUrl(
3850+
if (!useSeriesThumbs || item.type == 'Video' || item.type == 'MusicVideo') {
3851+
if (item.type == 'Episode' || item.type == 'Video' || item.type == 'MusicVideo') {
3852+
final videoPrimary = _resolvePrimaryImageUrl(
38513853
item,
38523854
imageApi,
38533855
maxHeight: maxH,
38543856
maxWidth: maxW,
38553857
);
3856-
if (episodePrimary != null) {
3857-
return episodePrimary;
3858+
if (videoPrimary != null) {
3859+
return videoPrimary;
38583860
}
38593861
} else if (item.type == 'Series') {
38603862
final latestEpId = item.rawData['LatestEpisodeId'] as String?;

0 commit comments

Comments
 (0)