[PR #287] [MERGED] Miscellaneous refactor and improvement #1640

Closed
opened 2026-03-14 15:24:54 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/aome510/spotify-player/pull/287
Author: @aome510
Created: 11/12/2023
Status: Merged
Merged: 11/12/2023
Merged by: @aome510

Base: masterHead: misc-cleanup


📝 Commits (8)

  • 4b4cfca add more details to no playback found message
  • 9986a48 use cargo environment variables to describe the application
  • fba5924 move static variables in State struct to Configs struct
  • 33da062 not require app's state to initialize other configs or handle CLI commands
  • f193be6 update *_config usage
  • 669b493 not return error for get_id_or_name
  • 166c9df handle connection refused error
  • 49d0b7d refactor the "send request" code to handle_cli_subcommand function

📊 Changes

19 files changed (+205 additions, -183 deletions)

View changed files

📝 spotify_player/Cargo.toml (+1 -1)
📝 spotify_player/src/auth.rs (+6 -6)
📝 spotify_player/src/cli/client.rs (+28 -14)
📝 spotify_player/src/cli/handlers.rs (+45 -54)
📝 spotify_player/src/cli/mod.rs (+2 -0)
📝 spotify_player/src/client/handlers.rs (+4 -3)
📝 spotify_player/src/client/mod.rs (+8 -8)
📝 spotify_player/src/config/mod.rs (+1 -5)
📝 spotify_player/src/event/mod.rs (+3 -1)
📝 spotify_player/src/event/page.rs (+10 -4)
📝 spotify_player/src/event/popup.rs (+10 -6)
📝 spotify_player/src/event/window.rs (+8 -4)
📝 spotify_player/src/main.rs (+21 -35)
📝 spotify_player/src/state/mod.rs (+30 -23)
📝 spotify_player/src/ui/mod.rs (+1 -1)
📝 spotify_player/src/ui/page.rs (+3 -3)
📝 spotify_player/src/ui/playback.rs (+20 -13)
📝 spotify_player/src/ui/popup.rs (+2 -0)
📝 spotify_player/src/ui/utils.rs (+2 -2)

📄 Description

Changes

  • use cargo environment variables to get the application's metadata
  • rename ratatui to tui in Cargo.toml instead of main.rs
  • move static variables in state::State struct to state::Configs struct
  • refactor and cleanup cli module

🔄 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/287 **Author:** [@aome510](https://github.com/aome510) **Created:** 11/12/2023 **Status:** ✅ Merged **Merged:** 11/12/2023 **Merged by:** [@aome510](https://github.com/aome510) **Base:** `master` ← **Head:** `misc-cleanup` --- ### 📝 Commits (8) - [`4b4cfca`](https://github.com/aome510/spotify-player/commit/4b4cfcac738b547a773b52f01ce0c11dab739bc4) add more details to no playback found message - [`9986a48`](https://github.com/aome510/spotify-player/commit/9986a4817b912fe46374399d24885219362bb2da) use cargo environment variables to describe the application - [`fba5924`](https://github.com/aome510/spotify-player/commit/fba59248ae05ee4f1309d39ba82f8615a5719a96) move static variables in `State` struct to `Configs` struct - [`33da062`](https://github.com/aome510/spotify-player/commit/33da0624e6cb6411526affa6d570e85dbf0fb9b9) not require app's state to initialize other configs or handle CLI commands - [`f193be6`](https://github.com/aome510/spotify-player/commit/f193be6f8c0f56de73a135199287c466770e9805) update `*_config` usage - [`669b493`](https://github.com/aome510/spotify-player/commit/669b493ae579495b576d46edd17df1249b2a7403) not return error for `get_id_or_name` - [`166c9df`](https://github.com/aome510/spotify-player/commit/166c9df6c1db961f48ac8b4f802ea7a73cea0702) handle connection refused error - [`49d0b7d`](https://github.com/aome510/spotify-player/commit/49d0b7dc8ed2df40745ec41a79a48f4a1dfaf76e) refactor the "send request" code to `handle_cli_subcommand` function ### 📊 Changes **19 files changed** (+205 additions, -183 deletions) <details> <summary>View changed files</summary> 📝 `spotify_player/Cargo.toml` (+1 -1) 📝 `spotify_player/src/auth.rs` (+6 -6) 📝 `spotify_player/src/cli/client.rs` (+28 -14) 📝 `spotify_player/src/cli/handlers.rs` (+45 -54) 📝 `spotify_player/src/cli/mod.rs` (+2 -0) 📝 `spotify_player/src/client/handlers.rs` (+4 -3) 📝 `spotify_player/src/client/mod.rs` (+8 -8) 📝 `spotify_player/src/config/mod.rs` (+1 -5) 📝 `spotify_player/src/event/mod.rs` (+3 -1) 📝 `spotify_player/src/event/page.rs` (+10 -4) 📝 `spotify_player/src/event/popup.rs` (+10 -6) 📝 `spotify_player/src/event/window.rs` (+8 -4) 📝 `spotify_player/src/main.rs` (+21 -35) 📝 `spotify_player/src/state/mod.rs` (+30 -23) 📝 `spotify_player/src/ui/mod.rs` (+1 -1) 📝 `spotify_player/src/ui/page.rs` (+3 -3) 📝 `spotify_player/src/ui/playback.rs` (+20 -13) 📝 `spotify_player/src/ui/popup.rs` (+2 -0) 📝 `spotify_player/src/ui/utils.rs` (+2 -2) </details> ### 📄 Description ## Changes - use cargo environment variables to get the application's metadata - rename `ratatui` to `tui` in `Cargo.toml` instead of `main.rs` - move static variables in `state::State` struct to `state::Configs` struct - refactor and cleanup `cli` module --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-14 15:24: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#1640
No description provided.