diff --git a/cmd/root.go b/cmd/root.go index 6363825cc..38c617bfd 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -179,10 +179,6 @@ func pidHashChanged(ds model.DataStore) (bool, error) { 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 diff --git a/db/migrations/20260525000912_set_default_pid_artist.sql b/db/migrations/20260525000912_set_default_pid_artist.sql new file mode 100644 index 000000000..cb12244fe --- /dev/null +++ b/db/migrations/20260525000912_set_default_pid_artist.sql @@ -0,0 +1,11 @@ +-- +goose Up +-- Backfill PIDArtist property to reflect the historical artist-ID computation. +-- Existing artist IDs were produced by the legacy hardcoded artistID() function, +-- which is byte-identical to computeArtistPID(p, "name", ...). Recording "name" +-- here ensures that on the next scan, prevArtistPIDConf is never empty — closing +-- the upgrade-time window where a user who pre-configured a non-default PID.Artist +-- would have artist IDs silently regenerated without annotation migration. +insert into property (id, value) values ('PIDArtist', 'name') on conflict do nothing; + +-- +goose Down +delete from property where id = 'PIDArtist';