feat: smart playlist seeding, per-user play tracking, and Playwright tests#9
Closed
psykzz wants to merge 4 commits into
Closed
feat: smart playlist seeding, per-user play tracking, and Playwright tests#9psykzz wants to merge 4 commits into
psykzz wants to merge 4 commits into
Conversation
- Add UserTrackStats model for per-user play/skip counts - Add Rating.implicit boolean to distinguish system-generated ratings - Remove Track.playCount (moved to per-user UserTrackStats) - Add Prisma migration for schema changes
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Smart Playlist Seeding & Per-User Play Tracking
Summary
This PR implements the full feature plan from
PLAN.md— per-user implicit rating system, smarter playlist generation with preference-based reseeding, onboarding cadence, and a Playwright e2e test suite.What Changed
Phase 1 — Per-User Play/Skip Tracking (schema)
UserTrackStatsmodel: per-userplayCountandskipCountper trackRating.implicitfield: distinguishes system-generated ratings from explicit user choicesTrack.playCount(was shared across all users, now per-user inUserTrackStats)Phase 2 — Implicit Rating Service
implicitRatingService.js: evaluatesnet = playCount - skipCountper user/track/api/tracks/completenow upsertsUserTrackStatsand callsevaluateImplicitRating/api/tracks/skipnew route — records skip event and re-evaluates implicit rating/api/ratingsdeletes any implicit rating before upserting an explicit one (explicit always wins)Phase 3 — Player Skip Detection
/completeelapsed ≥ 5sANDcurrentTime/duration < 20%— fires/skipPhase 4 — Onboarding Cadence
/api/onboarding/seedaccepts{ genres, cadence }and upsertsCadenceSettingSmart Playlist Generation (new)
score > 0always includedcleanupServicenow skips any track with a positive rating before deleting audio filesPreference-Based Reseeding
lastfmService: addedfetchSimilarArtistsschedulerService: smarterseedFromLastfmusesUserTrackStats+ ratings to build artist/genre preference profile; expands via similar artists; library soft cap of 250 tracksBug Fixes
X / Y done)Playwright E2E Test Suite (20 tests, all passing)
e2e/auth.spec.js— registration, login, error statese2e/onboarding.spec.js— genre selection, cadence step, back nav, seedinge2e/app.spec.js— profile menu z-index, debug page, download panel, player barTesting
All 20 Playwright tests pass locally.