diff --git a/core/artwork/reader_album.go b/core/artwork/reader_album.go index 0dbb88dab..680ce2349 100644 --- a/core/artwork/reader_album.go +++ b/core/artwork/reader_album.go @@ -53,10 +53,12 @@ func newAlbumArtworkReader(ctx context.Context, artwork *artwork, artID model.Ar lib: lib, } a.cacheKey.artID = artID - if a.updatedAt != nil && a.updatedAt.After(al.UpdatedAt) { + a.cacheKey.lastUpdate = al.UpdatedAt + if a.updatedAt != nil && a.updatedAt.After(a.cacheKey.lastUpdate) { a.cacheKey.lastUpdate = *a.updatedAt - } else { - a.cacheKey.lastUpdate = al.UpdatedAt + } + if al.ImportedAt.After(a.cacheKey.lastUpdate) { + a.cacheKey.lastUpdate = al.ImportedAt } return a, nil } diff --git a/core/artwork/reader_disc.go b/core/artwork/reader_disc.go index de0a765f0..9140d6f1e 100644 --- a/core/artwork/reader_disc.go +++ b/core/artwork/reader_disc.go @@ -105,10 +105,12 @@ func newDiscArtworkReader(ctx context.Context, a *artwork, artID model.ArtworkID updatedAt: imagesUpdatedAt, } r.cacheKey.artID = artID - if r.updatedAt != nil && r.updatedAt.After(al.UpdatedAt) { + r.cacheKey.lastUpdate = al.UpdatedAt + if r.updatedAt != nil && r.updatedAt.After(r.cacheKey.lastUpdate) { r.cacheKey.lastUpdate = *r.updatedAt - } else { - r.cacheKey.lastUpdate = al.UpdatedAt + } + if al.ImportedAt.After(r.cacheKey.lastUpdate) { + r.cacheKey.lastUpdate = al.ImportedAt } return r, nil } diff --git a/scanner/phase_3_refresh_albums.go b/scanner/phase_3_refresh_albums.go index 1de016988..33e0fed01 100644 --- a/scanner/phase_3_refresh_albums.go +++ b/scanner/phase_3_refresh_albums.go @@ -103,7 +103,6 @@ func (p *phaseRefreshAlbums) refreshAlbum(album *model.Album) (*model.Album, err return nil, nil } start := time.Now() - album.UpdatedAt = start err := p.ds.Album(p.ctx).Put(album) log.Debug(p.ctx, "Scanner: refreshing album", "album_id", album.ID, "name", album.Name, "songCount", album.SongCount, "elapsed", time.Since(start), err) if err != nil {