Skip to content

Seed titles (autocomplete + recommendations) + weighted-random deck order - #16

Merged
valeboth merged 1 commit into
mainfrom
feat/seeds-randomizer
Aug 25, 2026
Merged

valeboth merged 1 commit into
mainfrom
feat/seeds-randomizer

Conversation

@valeboth

Copy link
Copy Markdown
Owner

Seed titles + weighted-random deck order

Seeds ("titles you loved" — strongest signal)

  • Autocomplete: GET /api/search?q=… → TMDb search (KV-cached), 300ms debounce; a dropdown with poster + title + year + Movie/TV. Picked titles become removable chips.
  • Stored in profile.prefs.seeds ({tmdb_id, media_type}, max 6; ≤3/user used in the pool).
  • Pool with seeds: recommendations (/recommendations, /similar fallback) of both users' seeds drive the pool, plus a common-ground genre slice so overlap always exists. avoid_genres enforced on the recommendations (the API doesn't filter them). Union across both users. No seeds → the genre-union pool (unchanged).
  • Seeds only apply to the room's media type (recs of a movie are movies).

Randomizer

  • Deck order is now a per-user weighted shuffle at serve time: taste-biased (your favourites lift toward the top) but randomized — different each time and between the two users, so you don't always see the same sequence. Same shared pool → you still converge and match.

Verified local

  • Autocomplete "inception" → Inception (2010) ✅
  • Seed = Inception → deck is its recommendations (Oblivion, Insurgent, …) ✅
  • Seed + avoid Sci-Fi → zero Sci-Fi titles in the deck ✅
  • Two users' seeds (Inception + The Notebook) → pool has both sci-fi and romance ✅
  • Two /deck calls → different order ✅
  • lint/typecheck/build ✅

Free tier

  • Autocomplete: 1 TMDb call per debounced keystroke, KV-cached (repeats free).
  • Seed pool: ≤ ~1–2 calls per seed (≤3/user) + 1 common-ground call, all cached per room → well under the 50-subrequest limit.

…deck order

- seeds: 'titles you loved' with live autocomplete (GET /api/search -> TMDb search,
  KV-cached, 300ms debounce); picked titles stored in profile.prefs.seeds
- pool with seeds (strongest signal): recommendations (+ /similar fallback) of both
  users' seeds drive the pool + a common-ground genre slice; avoid_genres enforced on
  recs (the API doesn't filter them); union across users; no seeds -> genre-union pool
- randomizer: per-user weighted shuffle at serve time (taste-biased but varies each call
  and differs between users) instead of a fixed deterministic order
- seeds only apply to the room's media type; capped at 3/user (free-tier friendly)
- health -> v2.8

Tested local: autocomplete works, seed pool = recommendations, avoid removes those
genres from recs, two users' seeds union (sci-fi + romance), order differs across calls.
@valeboth
valeboth merged commit 330d4b8 into main Aug 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant