Skip to content
Snippets Groups Projects
Commit 026ad891 authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

macosx/library: don't try to show thumbnails for media where the generation failed

Just because the generation was started, does not mean it succeeded, so we cannot trust the state but need to check for the URL's validity.
parent 63b9ae09
No related branches found
No related tags found
No related merge requests found
......@@ -169,7 +169,7 @@ extern const long long int VLCMediaLibraryMediaItemDurationDenominator;
@property (readonly) time_t lastPlayedDate;
@property (readonly) NSString *title;
@property (readonly) NSString *smallArtworkMRL;
@property (readonly, nullable) NSString *smallArtworkMRL;
@property (readonly) BOOL smallArtworkGenerated;
@property (readonly) BOOL favorited;
......
......@@ -295,8 +295,12 @@ NSString *VLCMediaLibraryMediaItemLibraryID = @"VLCMediaLibraryMediaItemLibraryI
_playCount = p_mediaItem->i_playcount;
_lastPlayedDate = p_mediaItem->i_last_played_date;
_title = toNSStr(p_mediaItem->psz_title);
_smallArtworkMRL = toNSStr(p_mediaItem->thumbnails[VLC_ML_THUMBNAIL_SMALL].psz_mrl);
_smallArtworkGenerated = p_mediaItem->thumbnails[VLC_ML_THUMBNAIL_SMALL].b_generated;
_smallArtworkGenerated = p_mediaItem->thumbnails[VLC_ML_THUMBNAIL_SMALL].psz_mrl != NULL;
if (_smallArtworkGenerated) {
_smallArtworkMRL = toNSStr(p_mediaItem->thumbnails[VLC_ML_THUMBNAIL_SMALL].psz_mrl);
} else {
_smallArtworkMRL = nil;
}
_favorited = p_mediaItem->b_is_favorite;
switch (p_mediaItem->i_subtype) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment