mirror of
https://github.com/navidrome/navidrome.git
synced 2025-06-03 17:11:08 +03:00
fix: only update artists and albums if there were any changes in files
This commit is contained in:
parent
9fa73e3b7b
commit
edb839a41d
@ -144,8 +144,6 @@ func (s *TagScanner) processChangedDir(ctx context.Context, dir string, updatedA
|
|||||||
}
|
}
|
||||||
for _, t := range ct {
|
for _, t := range ct {
|
||||||
currentTracks[t.ID] = t
|
currentTracks[t.ID] = t
|
||||||
updatedArtists[t.ArtistID] = true
|
|
||||||
updatedAlbums[t.AlbumID] = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load tracks from the folder
|
// Load tracks from the folder
|
||||||
@ -178,8 +176,10 @@ func (s *TagScanner) processChangedDir(ctx context.Context, dir string, updatedA
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remaining tracks from DB that are not in the folder are deleted
|
// Remaining tracks from DB that are not in the folder are deleted
|
||||||
for id := range currentTracks {
|
for id, ct := range currentTracks {
|
||||||
numPurgedTracks++
|
numPurgedTracks++
|
||||||
|
updatedArtists[ct.ArtistID] = true
|
||||||
|
updatedAlbums[ct.AlbumID] = true
|
||||||
if err := s.ds.MediaFile(ctx).Delete(id); err != nil {
|
if err := s.ds.MediaFile(ctx).Delete(id); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user