Clear stale wanted rows for a song across all playlists on match, not just the current one #53

Merged
neerdoc merged 1 commit from macsome_12 into main 2026-08-02 10:06:40 +00:00
Owner

_buylist() aggregates the wanted table across ALL playlists, grouped by
(artist, title, album). But the previous cleanup on a Plex match only
deleted the wanted row keyed to the playlist currently being processed
(_key(t, pl.name)). A stale row left behind under a different playlist
(no longer synced, or matched independently in an earlier run) survived
and kept feeding the buylist / Plex Wish List even after the same song
was confirmed owned via another playlist occurrence.

Observed live: "Kings of Leon - Fans" matched at score 100 in two
different playlists in the same run, yet still went out to the Wish
List - a third, orphaned wanted row from another playlist context was
never cleared.

Now deletes every wanted row sharing the same normalized artist/title/
album, matching the exact grain _buylist() groups on.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

_buylist() aggregates the wanted table across ALL playlists, grouped by (artist, title, album). But the previous cleanup on a Plex match only deleted the wanted row keyed to the playlist currently being processed (_key(t, pl.name)). A stale row left behind under a different playlist (no longer synced, or matched independently in an earlier run) survived and kept feeding the buylist / Plex Wish List even after the same song was confirmed owned via another playlist occurrence. Observed live: "Kings of Leon - Fans" matched at score 100 in two different playlists in the same run, yet still went out to the Wish List - a third, orphaned wanted row from another playlist context was never cleared. Now deletes every wanted row sharing the same normalized artist/title/ album, matching the exact grain _buylist() groups on. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
_buylist() aggregates the wanted table across ALL playlists, grouped by
(artist, title, album). But the previous cleanup on a Plex match only
deleted the wanted row keyed to the playlist currently being processed
(_key(t, pl.name)). A stale row left behind under a different playlist
(no longer synced, or matched independently in an earlier run) survived
and kept feeding the buylist / Plex Wish List even after the same song
was confirmed owned via another playlist occurrence.

Observed live: "Kings of Leon - Fans" matched at score 100 in two
different playlists in the same run, yet still went out to the Wish
List - a third, orphaned wanted row from another playlist context was
never cleared.

Now deletes every wanted row sharing the same normalized artist/title/
album, matching the exact grain _buylist() groups on.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
WulfScience-FOSS/ha-music-own!53
No description provided.