Last.fm radio cache cap: 5 → 10
User-visible behavior: at most 10 mirrored Last.fm Radio rows exist at any time. When the cache prunes the 11th-newest + older lastfm_radio rows, the existing cascade-delete hook (``_cascade_delete_mirrored_for_mbids``) removes their matching ``source='lastfm'`` mirror rows in the same transaction. 5 was too aggressive — users seeding multiple radios in a row were losing earlier downloads' provenance before they had time to act on the tracks. 10 gives a few weeks of breathing room without letting the Mirrored tab balloon.
This commit is contained in:
parent
862cedde9d
commit
d8cc2f5f01
1 changed files with 7 additions and 3 deletions
|
|
@ -418,13 +418,17 @@ class ListenBrainzManager:
|
||||||
# the new rolling series mirrors (Phase 1c.2.1).
|
# the new rolling series mirrors (Phase 1c.2.1).
|
||||||
self._cleanup_per_period_series_mirrors(cursor)
|
self._cleanup_per_period_series_mirrors(cursor)
|
||||||
|
|
||||||
# For each playlist type, keep only the N most recent
|
# For each playlist type, keep only the N most recent.
|
||||||
# lastfm_radio keeps fewer since they're auto-regenerated weekly
|
# Last.fm radios are per-seed-track snapshots that don't update
|
||||||
|
# on the Last.fm side — capping the cache (and via the cascade
|
||||||
|
# below, the matching mirror rows) keeps the Mirrored tab from
|
||||||
|
# accumulating one row per random seed track the user ever
|
||||||
|
# picked. 10 is the user-facing limit.
|
||||||
playlist_type_limits = {
|
playlist_type_limits = {
|
||||||
'created_for': 25,
|
'created_for': 25,
|
||||||
'user': 25,
|
'user': 25,
|
||||||
'collaborative': 25,
|
'collaborative': 25,
|
||||||
'lastfm_radio': 5,
|
'lastfm_radio': 10,
|
||||||
}
|
}
|
||||||
|
|
||||||
for playlist_type, keep_count in playlist_type_limits.items():
|
for playlist_type, keep_count in playlist_type_limits.items():
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue