mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #681] [MERGED] fix(spotify): unbreak Game Mode playlist source on Development Mode apps #4727
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#4727
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/681
Author: @Romuromylus
Created: 5/11/2026
Status: ✅ Merged
Merged: 5/11/2026
Merged by: @Romuromylus
Base:
main← Head:fix/spotify-dev-mode-playlist-support📝 Commits (4)
1a04d7efix(spotify/game): use /playlists/{id}/items instead of deprecated /tracksbd27a0afix(spotify/game): map /playlists/{id}/items "item" wrapper alongside .tracka8a66cdfix(spotify/playlists): resolve real track counts; label followed playlists1c56b78fix(spotify/playlists): log /me failures, tri-state owned to avoid mislabel📊 Changes
4 files changed (+121 additions, -33 deletions)
View changed files
📝
packages/client/src/components/chat/ChatSettingsDrawer.tsx(+23 -8)📝
packages/client/src/components/game/GameSetupWizard.tsx(+23 -8)📝
packages/server/src/routes/spotify-auth.routes.ts(+50 -9)📝
packages/server/src/services/spotify/game-spotify-music.service.ts(+25 -8)📄 Description
Linked issue
Closes #680
Why this change
After Spotify's 2026-03 Web API migration, Game Mode's
playlistsource is completely broken for every Spotify Developer app in Development Mode (i.e. anyone who hasn't been granted Extended Quota Mode — which now requires 250k+ MAUs and so excludes essentially all self-hosted / hobby installs). Two distinct breaks:/playlists/{id}/tracks(deprecated). Spotify 403s every call, even for playlists the connected user owns. Scene music never plays from any playlist.playlist.tracks.totalfrom/me/playlists, but Spotify strips thetracksfield entirely from those items under Dev Mode. Every playlist renders asPlaylist Name (0), leaving users unable to tell which playlist has content and which is empty — or even that the data is unreliable.The end-to-end effect: a user on a fresh Spotify dev app sees a dropdown of
(0)playlists, picks one anyway, and gets a generic failure toast. There is no diagnostic visible to the user — the actual cause (Spotify policy) is invisible.What changed
Server (
packages/server/src/services/spotify/game-spotify-music.service.ts)fetchSpotifyTrackIndexfrom/playlists/{id}/tracksto/playlists/{id}/items. The replacement endpoint is the supported one and serves content for playlists owned by the connected user under Development Mode./me/trackswraps each track under.track, while/playlists/{id}/itemswraps the playable under.item(because an item may be a podcast episode). Mapping unchanged downstream.likedsource, surface a clearer message so the user understands the limitation: "Spotify only allows reading playlists owned by the connected account; followed or editorial playlists are blocked for Development Mode apps."Server (
packages/server/src/routes/spotify-auth.routes.ts)/playlistsnow resolves real track counts for self-owned playlists by calling/playlists/{id}/items?limit=1in parallel and using the returnedtotal. The previous code readtracks.totalfrom/me/playlists, which Dev Mode strips, so every entry was 0.trackCount: number | nulland a newowned: booleanso the client can render usable counts and label unusable playlists.Client (
packages/client/src/components/chat/ChatSettingsDrawer.tsx,packages/client/src/components/game/GameSetupWizard.tsx)/spotify/playliststotrackCount: number | nullandowned: boolean.Background (75)— owned, real count knownCustom Mix— owned, count unknown for any reason (no misleading(0))Fantasy vibes (followed — unavailable)— followed playlist, picking it will failValidation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Verified end-to-end on a live EasyPanel deployment running this branch's commits:
Background (75); scene-music shortlist returned 75 indexed tracks; sample candidate names (Peace Sign, Hijo de la Luna - Epic Orchestral Version, Hero of Our Time, Count the Teeth, Guren no Yumiya) matched the actual playlist; track played through the SDK device.JQBX :: Queue (0); correctly identified as empty by the server.Fantasy vibes (followed — unavailable); if explicitly selected and a scene triggered, the new clearer 403 message surfaces ("Spotify denied access to this playlist's contents...") instead of a generic failure./me/trackspath uses the existing.trackwrapper which the coalesced mapper still handles./searchpath is untouched by this PR.Manual verification to perform locally before merge:
(followed — unavailable)for followed ones.tracks.totalif Spotify provides it, otherwise the new/itemslookup fills it in.Docs and release impact
UI evidence (if applicable)
N/A — the visible change is the dropdown suffix; no layout or theming changes. (The before-state,
Background (0), is documented in #680 with a screenshot.)Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.