[PR #422] [MERGED] Decouple configs from application's state #758

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

📋 Pull Request Information

Original PR: https://github.com/aome510/spotify-player/pull/422
Author: @aome510
Created: 4/21/2024
Status: Merged
Merged: 4/21/2024
Merged by: @aome510

Base: masterHead: separate-configs-from-state


📝 Commits (4)

  • 7f62101 move Configs from state module to config module
  • 8cc38e0 use config::get_config() to get the application's configs
  • ff2dd6f remove redundant state: &SharedState as function's argument
  • 905a239 cleanup

📊 Changes

17 files changed (+193 additions, -263 deletions)

View changed files

📝 spotify_player/src/auth.rs (+2 -2)
📝 spotify_player/src/cli/handlers.rs (+4 -3)
📝 spotify_player/src/client/handlers.rs (+5 -3)
📝 spotify_player/src/client/mod.rs (+24 -23)
📝 spotify_player/src/config/mod.rs (+39 -3)
📝 spotify_player/src/event/mod.rs (+5 -9)
📝 spotify_player/src/event/page.rs (+15 -34)
📝 spotify_player/src/event/popup.rs (+2 -4)
📝 spotify_player/src/event/window.rs (+10 -25)
📝 spotify_player/src/main.rs (+17 -16)
📝 spotify_player/src/state/mod.rs (+6 -27)
📝 spotify_player/src/streaming.rs (+3 -2)
📝 spotify_player/src/ui/mod.rs (+5 -4)
📝 spotify_player/src/ui/page.rs (+21 -49)
📝 spotify_player/src/ui/playback.rs (+18 -20)
📝 spotify_player/src/ui/popup.rs (+13 -36)
📝 spotify_player/src/ui/utils.rs (+4 -3)

📄 Description

Changes

  • remove configs: Configs from application's State struct
  • add config::CONFIGS as a global static variable representing the application's configs
  • implement config::get_config to get a static reference of config::CONFIGS and config::set_config to set the global variable

🔄 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/422 **Author:** [@aome510](https://github.com/aome510) **Created:** 4/21/2024 **Status:** ✅ Merged **Merged:** 4/21/2024 **Merged by:** [@aome510](https://github.com/aome510) **Base:** `master` ← **Head:** `separate-configs-from-state` --- ### 📝 Commits (4) - [`7f62101`](https://github.com/aome510/spotify-player/commit/7f621017ebb00da872679205a56d6a3b03d90be3) move Configs from state module to config module - [`8cc38e0`](https://github.com/aome510/spotify-player/commit/8cc38e094699526ed9c8c9f4d2284819c2f30e05) use `config::get_config()` to get the application's configs - [`ff2dd6f`](https://github.com/aome510/spotify-player/commit/ff2dd6f290b41a8e111e8d8b8a9721690404cc42) remove redundant `state: &SharedState` as function's argument - [`905a239`](https://github.com/aome510/spotify-player/commit/905a2390503fb401b27de6ee2319690bfad0e7b2) cleanup ### 📊 Changes **17 files changed** (+193 additions, -263 deletions) <details> <summary>View changed files</summary> 📝 `spotify_player/src/auth.rs` (+2 -2) 📝 `spotify_player/src/cli/handlers.rs` (+4 -3) 📝 `spotify_player/src/client/handlers.rs` (+5 -3) 📝 `spotify_player/src/client/mod.rs` (+24 -23) 📝 `spotify_player/src/config/mod.rs` (+39 -3) 📝 `spotify_player/src/event/mod.rs` (+5 -9) 📝 `spotify_player/src/event/page.rs` (+15 -34) 📝 `spotify_player/src/event/popup.rs` (+2 -4) 📝 `spotify_player/src/event/window.rs` (+10 -25) 📝 `spotify_player/src/main.rs` (+17 -16) 📝 `spotify_player/src/state/mod.rs` (+6 -27) 📝 `spotify_player/src/streaming.rs` (+3 -2) 📝 `spotify_player/src/ui/mod.rs` (+5 -4) 📝 `spotify_player/src/ui/page.rs` (+21 -49) 📝 `spotify_player/src/ui/playback.rs` (+18 -20) 📝 `spotify_player/src/ui/popup.rs` (+13 -36) 📝 `spotify_player/src/ui/utils.rs` (+4 -3) </details> ### 📄 Description ## Changes - remove `configs: Configs` from application's `State` struct - add `config::CONFIGS` as a global static variable representing the application's configs - implement `config::get_config` to get a static reference of `config::CONFIGS` and `config::set_config` to set the global variable --- <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:41 +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#758
No description provided.