[PR #94] [MERGED] Implement tracks context #625

Closed
opened 2026-03-02 23:49:06 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/aome510/spotify-player/pull/94
Author: @aome510
Created: 12/24/2022
Status: Merged
Merged: 12/25/2022
Merged by: @aome510

Base: masterHead: add-tracks-context


📝 Commits (10+)

  • 10dda9d remove tracks page related structs and create new tracks context related structs
  • ee941df handle rendering for tracks context page
  • ad830ec refactor PlayRandom command and ordering commands handler codes
  • 7ff4dda add TrackId constants for some "tracks" contexts
  • 65128dc cleanup create_new_radio_page uses
  • 79b0599 add kind field to TracksId
  • e1c9a4d fix compile error in client codes
  • 30151e5 add once_cell and use it to construct global constant variables
  • ede65e5 use static instead of const when constructing once_cell::Lazy<TracksId>
  • a2b4681 modify GetRadioTracks structure

📊 Changes

16 files changed (+304 additions, -346 deletions)

View changed files

📝 Cargo.lock (+3 -2)
📝 spotify_player/Cargo.toml (+1 -0)
📝 spotify_player/src/client/handlers.rs (+1 -0)
📝 spotify_player/src/client/mod.rs (+39 -10)
📝 spotify_player/src/event/mod.rs (+24 -20)
📝 spotify_player/src/event/page.rs (+0 -120)
📝 spotify_player/src/event/popup.rs (+36 -21)
📝 spotify_player/src/event/window.rs (+73 -46)
spotify_player/src/state/consant.rs (+15 -0)
📝 spotify_player/src/state/data.rs (+18 -8)
📝 spotify_player/src/state/mod.rs (+2 -0)
📝 spotify_player/src/state/model.rs (+39 -38)
📝 spotify_player/src/state/ui/mod.rs (+12 -9)
📝 spotify_player/src/state/ui/page.rs (+26 -9)
📝 spotify_player/src/ui/mod.rs (+0 -1)
📝 spotify_player/src/ui/page.rs (+15 -62)

📄 Description

Overview

This PR adds new context type Tracks that should replace the use of tracks page and related structs. One benefit this change brings is that it allows to unify the handling codes for a tracks page and a context page, hence making the codes cleaner and easier to manage.

Changes

  • added structs/functions representing "tracks" context page's functionalities
  • removed structs/functions representing "tracks" page's functionalities
  • refactor command handling codes for context pages

🔄 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/aome510/spotify-player/pull/94 **Author:** [@aome510](https://github.com/aome510) **Created:** 12/24/2022 **Status:** ✅ Merged **Merged:** 12/25/2022 **Merged by:** [@aome510](https://github.com/aome510) **Base:** `master` ← **Head:** `add-tracks-context` --- ### 📝 Commits (10+) - [`10dda9d`](https://github.com/aome510/spotify-player/commit/10dda9d82d207d38799a51cc43cc0ea9f17ce47b) remove tracks page related structs and create new tracks context related structs - [`ee941df`](https://github.com/aome510/spotify-player/commit/ee941dfa43a7d3071a2b16166d4cb64539375769) handle rendering for tracks context page - [`ad830ec`](https://github.com/aome510/spotify-player/commit/ad830ec56b1bb6e63e149369d577aea38facb0e1) refactor `PlayRandom` command and ordering commands handler codes - [`7ff4dda`](https://github.com/aome510/spotify-player/commit/7ff4dda9baf891f947fade6e16107c2e3857b62a) add `TrackId` constants for some "tracks" contexts - [`65128dc`](https://github.com/aome510/spotify-player/commit/65128dc10f9eec46bed8e02e04a7a8b5fb69b43d) cleanup `create_new_radio_page` uses - [`79b0599`](https://github.com/aome510/spotify-player/commit/79b0599a9f490eabdea3994166b8749d27b6b1ce) add `kind` field to `TracksId` - [`e1c9a4d`](https://github.com/aome510/spotify-player/commit/e1c9a4d492c6bb840f3dd7792a301a2dbad3c5e6) fix compile error in client codes - [`30151e5`](https://github.com/aome510/spotify-player/commit/30151e5dd4882a04051016b11dd2490e1280ce05) add `once_cell` and use it to construct global constant variables - [`ede65e5`](https://github.com/aome510/spotify-player/commit/ede65e5dc14fc55a70b48c6b9f54c82016da863e) use `static` instead of `const` when constructing `once_cell::Lazy<TracksId>` - [`a2b4681`](https://github.com/aome510/spotify-player/commit/a2b46816dfb9eeb6110ed3b793576f661e2753d3) modify `GetRadioTracks` structure ### 📊 Changes **16 files changed** (+304 additions, -346 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+3 -2) 📝 `spotify_player/Cargo.toml` (+1 -0) 📝 `spotify_player/src/client/handlers.rs` (+1 -0) 📝 `spotify_player/src/client/mod.rs` (+39 -10) 📝 `spotify_player/src/event/mod.rs` (+24 -20) 📝 `spotify_player/src/event/page.rs` (+0 -120) 📝 `spotify_player/src/event/popup.rs` (+36 -21) 📝 `spotify_player/src/event/window.rs` (+73 -46) ➕ `spotify_player/src/state/consant.rs` (+15 -0) 📝 `spotify_player/src/state/data.rs` (+18 -8) 📝 `spotify_player/src/state/mod.rs` (+2 -0) 📝 `spotify_player/src/state/model.rs` (+39 -38) 📝 `spotify_player/src/state/ui/mod.rs` (+12 -9) 📝 `spotify_player/src/state/ui/page.rs` (+26 -9) 📝 `spotify_player/src/ui/mod.rs` (+0 -1) 📝 `spotify_player/src/ui/page.rs` (+15 -62) </details> ### 📄 Description ## Overview This PR adds new context type `Tracks` that should replace the use of tracks page and related structs. One benefit this change brings is that it allows to unify the handling codes for a tracks page and a context page, hence making the codes cleaner and easier to manage. ## Changes - added structs/functions representing "tracks" context page's functionalities - removed structs/functions representing "tracks" page's functionalities - refactor command handling codes for context pages --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:49:06 +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/spotify-player#625
No description provided.