[PR #219] [MERGED] 214 stop playback if user playback state is paused or doesnt exist on queue event #327

Closed
opened 2026-02-27 19:17:47 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/EddieTheCubeHead/Stagnum/pull/219
Author: @EddieTheCubeHead
Created: 4/12/2024
Status: Merged
Merged: 4/12/2024
Merged by: @EddieTheCubeHead

Base: masterHead: 214-stop-playback-if-user-playback-state-is-paused-or-doesnt-exist-on-queue-event


📝 Commits (8)

  • e013ee5 214 Scheduled job now knows how to refresh token as well
  • c556ede 214 Add alembic script for db changes
  • 1320524 214 Stop playback and delete pool if spotify player no longer present
  • 45c7a48 214 Raise error on song skip if playback is missing
  • e0d082a 214 Stop playback on spotify paused, throw error if skipping while spotify paused
  • aa333e2 214 Alembic script unnecessary comment renewals
  • 855a11e Merge branch 'master' into 214-stop-playback-if-user-playback-state-is-paused-or-doesnt-exist-on-queue-event
  • 81e3824 214 Fix bug causing all CICD runs to fail(?)

📊 Changes

15 files changed (+295 additions, -88 deletions)

View changed files

📝 client/app/about/page.tsx (+2 -0)
server/src/alembic/versions/a864a5084871_new_field_for_user_session_for_storing_.py (+26 -0)
📝 server/src/alembic/versions/aeb0c7f142d6_increase_field_sizes_for_pool_members.py (+0 -4)
📝 server/src/api/common/dependencies.py (+9 -3)
📝 server/src/api/pool/dependencies.py (+39 -7)
server/src/api/pool/exceptions.py (+0 -7)
📝 server/src/database/entities.py (+1 -0)
📝 server/test/auth_features/conftest.py (+0 -29)
server/test/auth_features/refresh_token_features.py (+0 -22)
📝 server/test/conftest.py (+29 -2)
📝 server/test/pool_features/add_content_features.py (+4 -4)
📝 server/test/pool_features/conftest.py (+28 -2)
📝 server/test/pool_features/playback_features.py (+67 -8)
server/test/pool_features/refresh_token_features.py (+63 -0)
📝 server/test/pool_features/shared_pool_features.py (+27 -0)

📄 Description

Main functionality added:

  • When a queue song event is fired, user token is refreshed if it's old
    • The last token used for login is stored and can be used to login once: this login headers return the refreshed token and the old token can no longer be used for login
  • When a queue song event or skip song API call is fired, the following checks are performed:
    1. Ensure the spotify playback state for the user is not NULL (no player)
    2. Ensure the spotify playback state for the user is active (not paused)
    • If either fails, the playback is stopped on queue event, or an error is returned to client on API call

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/EddieTheCubeHead/Stagnum/pull/219 **Author:** [@EddieTheCubeHead](https://github.com/EddieTheCubeHead) **Created:** 4/12/2024 **Status:** ✅ Merged **Merged:** 4/12/2024 **Merged by:** [@EddieTheCubeHead](https://github.com/EddieTheCubeHead) **Base:** `master` ← **Head:** `214-stop-playback-if-user-playback-state-is-paused-or-doesnt-exist-on-queue-event` --- ### 📝 Commits (8) - [`e013ee5`](https://github.com/EddieTheCubeHead/Stagnum/commit/e013ee532148515436ab2a09afd931d6a19f5707) 214 Scheduled job now knows how to refresh token as well - [`c556ede`](https://github.com/EddieTheCubeHead/Stagnum/commit/c556ede62d00f897763c7dec7ce34c39c09efca3) 214 Add alembic script for db changes - [`1320524`](https://github.com/EddieTheCubeHead/Stagnum/commit/1320524a5bebba0836c23c014967e2d76b908c23) 214 Stop playback and delete pool if spotify player no longer present - [`45c7a48`](https://github.com/EddieTheCubeHead/Stagnum/commit/45c7a48813d5712ffcc47569fbd6cdca6ae76b26) 214 Raise error on song skip if playback is missing - [`e0d082a`](https://github.com/EddieTheCubeHead/Stagnum/commit/e0d082aa78b25182183655af4b8f5e6c9c1ee461) 214 Stop playback on spotify paused, throw error if skipping while spotify paused - [`aa333e2`](https://github.com/EddieTheCubeHead/Stagnum/commit/aa333e2ff409550d58c85a383440bd6c89669a4f) 214 Alembic script unnecessary comment renewals - [`855a11e`](https://github.com/EddieTheCubeHead/Stagnum/commit/855a11ef98f98746b8246ba0cb6a30f3e0dbbce3) Merge branch 'master' into 214-stop-playback-if-user-playback-state-is-paused-or-doesnt-exist-on-queue-event - [`81e3824`](https://github.com/EddieTheCubeHead/Stagnum/commit/81e3824a556bb926f98d737e305c0fdeb51fc802) 214 Fix bug causing all CICD runs to fail(?) ### 📊 Changes **15 files changed** (+295 additions, -88 deletions) <details> <summary>View changed files</summary> 📝 `client/app/about/page.tsx` (+2 -0) ➕ `server/src/alembic/versions/a864a5084871_new_field_for_user_session_for_storing_.py` (+26 -0) 📝 `server/src/alembic/versions/aeb0c7f142d6_increase_field_sizes_for_pool_members.py` (+0 -4) 📝 `server/src/api/common/dependencies.py` (+9 -3) 📝 `server/src/api/pool/dependencies.py` (+39 -7) ➖ `server/src/api/pool/exceptions.py` (+0 -7) 📝 `server/src/database/entities.py` (+1 -0) 📝 `server/test/auth_features/conftest.py` (+0 -29) ➖ `server/test/auth_features/refresh_token_features.py` (+0 -22) 📝 `server/test/conftest.py` (+29 -2) 📝 `server/test/pool_features/add_content_features.py` (+4 -4) 📝 `server/test/pool_features/conftest.py` (+28 -2) 📝 `server/test/pool_features/playback_features.py` (+67 -8) ➕ `server/test/pool_features/refresh_token_features.py` (+63 -0) 📝 `server/test/pool_features/shared_pool_features.py` (+27 -0) </details> ### 📄 Description Main functionality added: - When a queue song event is fired, user token is refreshed if it's old - The last token used for login is stored and can be used to login once: this login headers return the refreshed token and the old token can no longer be used for login - When a queue song event or skip song API call is fired, the following checks are performed: 1. Ensure the spotify playback state for the user is not NULL (no player) 2. Ensure the spotify playback state for the user is active (not paused) - If either fails, the playback is stopped on queue event, or an error is returned to client on API call --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 19:17:47 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Stagnum#327
No description provided.