Skip to content

Commit

Permalink
cocoaui: fix medialib artwork cache collisions
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksiy-Yakovenko committed Dec 7, 2023
1 parent 391bdda commit e972757
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions plugins/cocoaui/MediaLibrary/MediaLibraryOutlineViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -522,10 +522,16 @@ static void cover_get_callback (int error, ddb_cover_query_t *query, ddb_cover_i
}

- (NSString *)albumArtCacheKeyForTrack:(ddb_playItem_t *)track {
const char *artist = deadbeef->pl_find_meta (track, "artist") ?: "Unknown Artist";
const char *album = deadbeef->pl_find_meta (track, "album") ?: "Unknown Album";
const char *artist = deadbeef->pl_find_meta (track, "artist");
const char *album = deadbeef->pl_find_meta (track, "album");

return [NSString stringWithFormat:@"artist:%s;album:%s", artist, album];
if (artist != NULL && album != NULL) {
return [NSString stringWithFormat:@"artist:%s;album:%s", artist, album];
}
else {
const char *path = deadbeef->pl_find_meta(track, ":URI");
return [NSString stringWithFormat:@"file:%s", path];
}
}

// NOTE: this is running on background thread
Expand Down

0 comments on commit e972757

Please sign in to comment.