[PR #19] [MERGED] Rewrite application state's data model #581

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

📋 Pull Request Information

Original PR: https://github.com/aome510/spotify-player/pull/19
Author: @aome510
Created: 10/26/2021
Status: Merged
Merged: 10/26/2021
Merged by: @aome510

Base: masterHead: rewrite-app-data-model


📝 Commits (10+)

  • f7b528d add state/data.rs and state/model.rs
  • 831e486 change data model of enums in state/ui.rs
  • 02684c3 remove unneeded import in main.rs
  • eef4426 cleanup state module codes
  • 07621f5 re-export all state structs
  • 62485fe fix the errors in the client module
  • 4f54d96 use a helper function to create new WindowState::Searching
  • b2fc628 fix errors in the ui module
  • 6bcb18b use tuple enum for majority of state::ui::PopupState's variants
  • 790710f fix errors in event module

📊 Changes

16 files changed (+1071 additions, -987 deletions)

View changed files

📝 spotify_player/src/client/mod.rs (+130 -197)
📝 spotify_player/src/event/mod.rs (+12 -19)
📝 spotify_player/src/event/popup.rs (+37 -25)
📝 spotify_player/src/event/window.rs (+111 -93)
📝 spotify_player/src/main.rs (+4 -6)
spotify_player/src/state/data.rs (+35 -0)
📝 spotify_player/src/state/mod.rs (+8 -3)
spotify_player/src/state/model.rs (+418 -0)
📝 spotify_player/src/state/player.rs (+11 -433)
📝 spotify_player/src/state/ui.rs (+150 -99)
📝 spotify_player/src/ui/context.rs (+22 -14)
📝 spotify_player/src/ui/help.rs (+1 -1)
📝 spotify_player/src/ui/mod.rs (+23 -23)
📝 spotify_player/src/ui/popup.rs (+24 -17)
📝 spotify_player/src/ui/search.rs (+63 -43)
📝 spotify_player/src/utils.rs (+22 -14)

📄 Description

Brief description of changes

  • add state/model.rs module to store the application's Spotify models
  • separate the application's state and data
    • Previously, application data such as caches, user data, etc are stored inside the player state.
    • Now, state::data::AppData is used to store those the application's data.
  • add some cleanups, documentation/naming changes, and code refactors while making changes for the new data/state structure

🔄 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/19 **Author:** [@aome510](https://github.com/aome510) **Created:** 10/26/2021 **Status:** ✅ Merged **Merged:** 10/26/2021 **Merged by:** [@aome510](https://github.com/aome510) **Base:** `master` ← **Head:** `rewrite-app-data-model` --- ### 📝 Commits (10+) - [`f7b528d`](https://github.com/aome510/spotify-player/commit/f7b528d2871d2bc0f868d0b40026d712c0997d07) add `state/data.rs` and `state/model.rs` - [`831e486`](https://github.com/aome510/spotify-player/commit/831e4867052c236af5c67d5a65ed478f8257053b) change data model of enums in `state/ui.rs` - [`02684c3`](https://github.com/aome510/spotify-player/commit/02684c3ef191b7aae30425af35bef031dd2567a0) remove unneeded import in `main.rs` - [`eef4426`](https://github.com/aome510/spotify-player/commit/eef44265fa1762eaaed74c03ac29d32acec2eaf4) cleanup `state` module codes - [`07621f5`](https://github.com/aome510/spotify-player/commit/07621f591b7a6421ede0e5e75bb7c959beb2ac3f) re-export all state structs - [`62485fe`](https://github.com/aome510/spotify-player/commit/62485fe00b0705ecbd0e99ba76a5d5d07c6e1fed) fix the errors in the `client` module - [`4f54d96`](https://github.com/aome510/spotify-player/commit/4f54d96abe57462750730929f3c253cede2309b2) use a helper function to create new `WindowState::Searching` - [`b2fc628`](https://github.com/aome510/spotify-player/commit/b2fc628584227f944b7262d18267f32b9f4b2bf7) fix errors in the `ui` module - [`6bcb18b`](https://github.com/aome510/spotify-player/commit/6bcb18b846b07434b525db08cd466ce8f96619ab) use tuple enum for majority of `state::ui::PopupState`'s variants - [`790710f`](https://github.com/aome510/spotify-player/commit/790710f1bcf2c7cd0513512a330f27afff07eece) fix errors in `event` module ### 📊 Changes **16 files changed** (+1071 additions, -987 deletions) <details> <summary>View changed files</summary> 📝 `spotify_player/src/client/mod.rs` (+130 -197) 📝 `spotify_player/src/event/mod.rs` (+12 -19) 📝 `spotify_player/src/event/popup.rs` (+37 -25) 📝 `spotify_player/src/event/window.rs` (+111 -93) 📝 `spotify_player/src/main.rs` (+4 -6) ➕ `spotify_player/src/state/data.rs` (+35 -0) 📝 `spotify_player/src/state/mod.rs` (+8 -3) ➕ `spotify_player/src/state/model.rs` (+418 -0) 📝 `spotify_player/src/state/player.rs` (+11 -433) 📝 `spotify_player/src/state/ui.rs` (+150 -99) 📝 `spotify_player/src/ui/context.rs` (+22 -14) 📝 `spotify_player/src/ui/help.rs` (+1 -1) 📝 `spotify_player/src/ui/mod.rs` (+23 -23) 📝 `spotify_player/src/ui/popup.rs` (+24 -17) 📝 `spotify_player/src/ui/search.rs` (+63 -43) 📝 `spotify_player/src/utils.rs` (+22 -14) </details> ### 📄 Description ## Brief description of changes - add `state/model.rs` module to store the application's Spotify models - separate the application's state and data + Previously, application data such as caches, user data, etc are stored inside the player state. + Now, `state::data::AppData` is used to store those the application's data. - add some cleanups, documentation/naming changes, and code refactors while making changes for the new data/state structure --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:48:54 +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#581
No description provided.