Repository navigation
Party mode: guests join with a code and add songs to the queue - #163
Merged
Merged
Conversation
Hosts start a party (name, wait between adds, songs waiting per guest, voting) and share a six-letter code. Guests open /join/<code> on their phones without a Tomify login, search the library, add songs and vote. The host's player puts the next guest song after the current track. Guests search as a party login when one is set, otherwise as the host, whose token is sealed with TOMIFY_MEDIA_KEY and deleted with the party. Closes #162 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VYE1d3E4kQyA3bwSz73av4
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.
Requested by Tom · project thread
Before: only the signed-in account could add to what's playing.
After: Party mode (sidebar, or the account sheet on mobile) starts a named party such as "Tomify Rocks!" and shows a six-letter access code and a
/join/<code>link. Guests open the link on their phones, type their name (no Tomify account needed), search the library, add songs, see what's playing and what's next, and vote. The host sets a wait between each guest's adds (off, or 30 seconds to 10 minutes), how many songs each guest can have waiting, and whether voting is on. The host can remove songs or guests, and can end the party.Closes #162.
How
worker/features/party.ts, routes under/api/party(host: start/load/update/end, set an item queued/played, remove item/guest; guest:/join,/guest,/guest/search,/guest/queue,/guest/vote/:id,/guest/cover/:id). New migrationdrizzle/0017_parties.sql(parties,party_guests,party_queue,party_votes). Guest songs are re-read withgetSongso guests can't inject track data, and guests only get song fields (no file paths).TOMIFY_MEDIA_KEY(already set in prod) and deleted when the party ends or goes idle for 12 hours. Tom's alternative is also supported: ifTOMIFY_PARTY_USERNAMEandTOMIFY_PARTY_PASSWORDare set, guests use that Navidrome account and the host's login isn't stored.src/stores/party.ts,PartyRuntimein the app shell): every 5 s it inserts the top waiting song straight after the current track, one at a time, so votes keep reordering the rest. It reports now playing for guests and marks songs played once they start. Only the device that started the party (or the one playing) does this, so a second open tab doesn't add songs twice.src/pages/PartyGuest.tsxrenders before the login check for/join/..., and the guest token is kept in localStorage.Tests
nextPartyStep(vitest) andorderPartyQueue.pnpm lint(2 existing warnings),typecheck,test, andbuildall pass.Deploy
Site only. Merging auto-deploys it, and
pnpm run deployapplies D1 migration0017_parties.sql. No agent change. If the Cloudflare build doesn't apply migrations, runnpx pnpm run deployonce.Generated by Claude Code