From bf88c57454beef07c46f3356e4717d28153c16de Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Thu, 10 Feb 2022 22:45:26 -0800 Subject: [PATCH] Minor artwork caching changes Art ID should be set on new files when they are stored into the database, and the album art property should be affected by assigning to the artId property, since it affects the caching identifier. Signed-off-by: Christopher Snowhill --- Playlist/PlaylistEntry.m | 2 +- Utils/SQLiteStore.m | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Playlist/PlaylistEntry.m b/Playlist/PlaylistEntry.m index 2728dfd8b..20f6b1b55 100644 --- a/Playlist/PlaylistEntry.m +++ b/Playlist/PlaylistEntry.m @@ -120,7 +120,7 @@ } + (NSSet *)keyPathsForValuesAffectingAlbumArt { - return [NSSet setWithObject:@"albumArtInternal"]; + return [NSSet setWithObjects:@"albumArtInternal", @"artId", nil]; } + (NSSet *)keyPathsForValuesAffectingGainCorrection { diff --git a/Utils/SQLiteStore.m b/Utils/SQLiteStore.m index 1d4bd485f..dfc60f313 100644 --- a/Utils/SQLiteStore.m +++ b/Utils/SQLiteStore.m @@ -1037,6 +1037,7 @@ static SQLiteStore *g_sharedStore = NULL; if(albumArt) artId = [self addArt:albumArt]; + [track setArtId:artId]; st = stmt[stmt_add_track]; @@ -1232,6 +1233,7 @@ static SQLiteStore *g_sharedStore = NULL; if(albumArt) artId = [self addArt:albumArt]; + [track setArtId:artId]; st = stmt[stmt_update_track];