mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-21 01:19:58 +01:00
feat(scanner): trigger rescan when PID.Artist changes
This commit is contained in:
parent
12980e8d88
commit
46cb9f8d58
2 changed files with 16 additions and 1 deletions
12
cmd/root.go
12
cmd/root.go
|
|
@ -175,7 +175,17 @@ func pidHashChanged(ds model.DataStore) (bool, error) {
|
|||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
return !strings.EqualFold(pidAlbum, conf.Server.PID.Album) || !strings.EqualFold(pidTrack, conf.Server.PID.Track), nil
|
||||
pidArtist, err := ds.Property(context.Background()).DefaultGet(consts.PIDArtistKey, "")
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
// Empty stored value is treated as matching — fresh upgrade should not force a rescan.
|
||||
if pidArtist == "" {
|
||||
pidArtist = conf.Server.PID.Artist
|
||||
}
|
||||
return !strings.EqualFold(pidAlbum, conf.Server.PID.Album) ||
|
||||
!strings.EqualFold(pidTrack, conf.Server.PID.Track) ||
|
||||
!strings.EqualFold(pidArtist, conf.Server.PID.Artist), nil
|
||||
}
|
||||
|
||||
// runInitialScan runs an initial scan of the music library if needed.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue