From ab1c943d1f8d75fcd683a2e7ff6df61ec7c3b28a Mon Sep 17 00:00:00 2001 From: Deluan Date: Sat, 27 Jun 2020 18:41:55 -0400 Subject: [PATCH] Force album/artist refresh when folder changes, to cater for cover art files --- scanner/tag_scanner.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scanner/tag_scanner.go b/scanner/tag_scanner.go index d9d492449..860ed951c 100644 --- a/scanner/tag_scanner.go +++ b/scanner/tag_scanner.go @@ -175,6 +175,17 @@ func (s *TagScanner) processChangedDir(ctx context.Context, dir string, updatedA filesToUpdate = append(filesToUpdate, filePath) } delete(currentTracks, filePath) + + // Force a refresh of the album and artist, to cater for cover art files. Ideally we would only do this + // if there are any image file in the folder (TODO) + err = s.updateAlbum(ctx, c.AlbumID, updatedAlbums) + if err != nil { + return err + } + err = s.updateArtist(ctx, c.AlbumArtistID, updatedArtists) + if err != nil { + return err + } } numUpdatedTracks := 0