add frequently and recently played album and artist sorts

Song playCount/played are parsed and synced, then aggregated per album
(SUM/MAX) and per artist (through the album's artistId) after the song
sync. Albums and artists gain Frequent/Recent sorts with their own
indices; the options show only when the active source returned the
fields, and the aggregate only writes rows whose value changed.

The artist subqueries pin index_albums_sourceId_artistId: without it the
planner answers MAX(played) from index_albums_recent (sourceId, played),
which cannot apply the artistId equality, and scans every album once per
artist. The availability flows read the indexed album ranks rather than
scanning songs, which would re-run on every song-sync batch.
This commit is contained in:
austinried
2026-10-04 00:30:05 +00:00
parent a261612017
commit 06ca2da48d
17 changed files with 1905 additions and 28 deletions
File diff suppressed because it is too large Load Diff