feat: rotate recommendations after a few plays
CI / chart (push) Successful in 3s
CI / test (push) Successful in 2m4s
CI / chart-push (push) Successful in 3s
CI / image (push) Failing after 6m21s

- V12 rebuilds mood_recommendations with a rotated state, play_count and
  rotated_at, plus a per-mood recommendation_rotation_plays (default 3)
- count a play when a session reports started; retire the slot at the limit
  and let TopUpService refill it, with discovery only when the pool is empty
- add POST /moods/{id}/recommendations/rotate for the All new action, which
  retires every active slot and forces discovery
- turned a rotated slot's late download completion into REJECTED so it cannot
  reappear as ready
- revive rotated slots after a 30-day cooldown to avoid draining the catalog
- expose playCount and recommendationRotationPlays in the API, chart 0.6.0
This commit is contained in:
TapTap committed 2026-11-22 17:31:28 +00:00
1 parent 44b75c4d4d
commit a3c5da559b
15 files changed
+507 -8

No files matched your search

+9 -1
View File
@@ -760,7 +760,15 @@ Phases 1-8 are implemented in both repositories.
Uncaught exceptions are stored on Android and desktop and uploaded on the next
launch. Every response carries `X-Request-Id`, which the client includes in
server-error diagnostics so a report can be matched to the server log.
- Tests: 26 client tests; desktop, Android debug and Wasm compile.
- **Rotation (V12)**: `mood_recommendations.play_count` counts plays (`started`
events). At `moods.recommendation_rotation_plays` (0–100, default 3) the slot
becomes `rotated` and TopUpService fills it from the hidden pool. Rotated rows
are a 30-day cooldown, not a rejection: discovery revives them as `new`
candidates after that. `POST /moods/{id}/recommendations/rotate` retires every
active slot for the **All new** action; plain `refresh` still only discovers
and tops up. The file follows the usual reference rules and is deleted by the
GC once no mood or open session needs it.
- Tests: 28 client tests; desktop, Android debug and Wasm compile.
### Known follow-ups