feat(scanner): trigger rescan when PID.Artist changes

This commit is contained in:
Deluan 2026-05-24 19:35:03 -03:00
commit 46cb9f8d58
2 changed files with 16 additions and 1 deletions

View file

@ -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.