Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: persist queue and playback state (closes #1675) #1735

Merged
merged 14 commits into from Jan 1, 2024
Merged

feat: persist queue and playback state (closes #1675) #1735

merged 14 commits into from Jan 1, 2024

Conversation

phanan
Copy link
Member

@phanan phanan commented Dec 29, 2023

WIP. This should close #1675 and bring some pretty nice UX.

Copy link

what-the-diff bot commented Dec 29, 2023

PR Summary

  • Added required elements for QueueState management

    • QueueStateResource, which is a critical component for handling the operations associated with the queue state was added.
    • QueueState model and related database schema were created to handle and store queue states.
    • QueueService service and UpdatePlaybackStatusRequest and UpdateQueueStateRequest classes were introduced to perform operations associated with queue states.
  • Extended existing Controllers and Repositories

    • DataController and QueueController were modified, now they also manage the queue_state field and respective functions.
    • SongRepository and ArtistRepository were extended to be more versatile by introducing extra methods and parameters.
    • Repository and RepositoryInterface got new optional parameters for the getByIds method.
    • The excerptSearch method in the SearchService and the orderByArray macro in the MacroProvider were refined.
  • Enhanced User Interface Components

    • Certain UI components such as ExtraDrawer, SongContextMenu, and SongThumbnail were modified to improve the user experience.
  • Improved Service Interactions and Test Cases

    • The http.ts service was modified to improve data interaction.
    • Several new import statements were included for a better modular structure.
    • QueueState interface received a new property playback_position.
    • New routes such as getState, updateState, and updatePlaybackStatus were defined in api.base.php.
    • Several new tests were introduced to ensure the proper working of the Queue functionality.
    • A log macro was added to TestResponse class for better test result logging.
  • Performed Minor Code Optimizations

    • Replaced some instances of '$originalSongs' with '$originalSongIds' for improving code readability and performance.
    • A new test file QueueServiceTest was added to specifically test the functionality of the QueueService. Various methods were included within this class to test every aspect of the QueueService.

@codecov-commenter
Copy link

codecov-commenter commented Dec 29, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ce0ed4a) 83.77% compared to head (3aa03e7) 84.10%.
Report is 1 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1735      +/-   ##
============================================
+ Coverage     83.77%   84.10%   +0.32%     
- Complexity      651      664      +13     
============================================
  Files           144      147       +3     
  Lines          1763     1799      +36     
============================================
+ Hits           1477     1513      +36     
  Misses          286      286              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@phanan phanan marked this pull request as ready for review January 1, 2024 11:40
@phanan phanan merged commit 5f0eaf2 into master Jan 1, 2024
12 checks passed
@phanan phanan deleted the queue branch January 1, 2024 11:40
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.

[feat] Allow resuming of a song that was previously playing.
2 participants