[PR #15] [MERGED] [#14] upgrade to rspotify v0.11 #576

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

📋 Pull Request Information

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

Base: masterHead: 14-upgrade-rspotify


📝 Commits (10+)

  • e403594 update dependencies
  • fd5e29a fix the errors happening b/c of the librespot libraries update
  • e11043c migrate rspotify to a new version in player.rs
  • c5de7b1 replace get_ with ``
  • 2c93765 use namespace for variables and functions from other modules in player.rs
  • 5afaade modify token::get_token to return rspotify::Token instead of a custom Token
  • ef2bf31 add client::spotify.rs module implementing a Spotify client on top of rspotify client traits
  • 5742edd add client::handlers implement event handling functions
  • e341aae rewrite majority of client's handling functions with rspotify v0.11
  • 4c44d9c modify state::{Track,Album,Artist} to ensure that the id field is not None

📊 Changes

21 files changed (+2057 additions, -2623 deletions)

View changed files

📝 Cargo.lock (+612 -1181)
📝 spotify_player/Cargo.toml (+22 -21)
📝 spotify_player/src/auth.rs (+1 -1)
spotify_player/src/client.rs (+0 -997)
spotify_player/src/client/handlers.rs (+167 -0)
spotify_player/src/client/mod.rs (+691 -0)
spotify_player/src/client/spotify.rs (+149 -0)
📝 spotify_player/src/connect.rs (+11 -10)
📝 spotify_player/src/event/mod.rs (+25 -36)
📝 spotify_player/src/event/popup.rs (+37 -41)
📝 spotify_player/src/event/window.rs (+62 -66)
📝 spotify_player/src/main.rs (+7 -11)
📝 spotify_player/src/state/mod.rs (+1 -1)
📝 spotify_player/src/state/player.rs (+204 -177)
📝 spotify_player/src/state/ui.rs (+9 -11)
📝 spotify_player/src/token.rs (+18 -32)
📝 spotify_player/src/ui/context.rs (+16 -15)
📝 spotify_player/src/ui/mod.rs (+7 -8)
📝 spotify_player/src/ui/popup.rs (+2 -2)
📝 spotify_player/src/ui/search.rs (+1 -5)

...and 1 more files

📄 Description

Brief description of changes

  • upgrade the application's dependencies:
    • rspotify to v0.11.2
    • librespot to v0.3.0 (now a single library instead of multiple librespot-* libraries)
    • and other dependencies
  • remove client.rs and replace with a client folder module, which includes:
    • client/mod.rs: consists of client::Client's definition and its method implementations
    • client/handlers.rs: consists of functions that handle player events, client requests, etc
    • client/spotify.rs: consists of client::Spotify's (a client to interact with Spotify APIs) definition and its method implementations
  • rewrote majority of client functions' implementations in client/mod.rs:
    • switch to rspotify's async functions
    • simplify the handling logics
  • integrate rspotify type-safe item's ID (TrackId, AlbumId, etc)
  • require state::{Track,Album,Artist,Playlist} to be always in a valid state (having a valid id).
    In other words, parsing from a rspotify's item can possible be fail (e.g rspotify::SImplifiedAlbum to state::Album)
  • replace get_X method in a struct with X to follow idomatic Rust

🔄 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/15 **Author:** [@aome510](https://github.com/aome510) **Created:** 10/17/2021 **Status:** ✅ Merged **Merged:** 10/17/2021 **Merged by:** [@aome510](https://github.com/aome510) **Base:** `master` ← **Head:** `14-upgrade-rspotify` --- ### 📝 Commits (10+) - [`e403594`](https://github.com/aome510/spotify-player/commit/e40359418f6e53a66735f26b10af091703be9ca1) update dependencies - [`fd5e29a`](https://github.com/aome510/spotify-player/commit/fd5e29a3b5e17b5dc5cff6028684f1c71d5a5d0e) fix the errors happening b/c of the `librespot` libraries update - [`e11043c`](https://github.com/aome510/spotify-player/commit/e11043cccf17ce9e343065b41f65a2b23c467c04) migrate `rspotify` to a new version in `player.rs` - [`c5de7b1`](https://github.com/aome510/spotify-player/commit/c5de7b16182d57929de458f5ba696a2cbcf42007) replace `get_` with `` - [`2c93765`](https://github.com/aome510/spotify-player/commit/2c937653373739f697283cd2d6460079cd3c00fa) use namespace for variables and functions from other modules in `player.rs` - [`5afaade`](https://github.com/aome510/spotify-player/commit/5afaadea570cc696a2ce8d1dd382b3aa0ac30e26) modify `token::get_token` to return `rspotify::Token` instead of a custom Token - [`ef2bf31`](https://github.com/aome510/spotify-player/commit/ef2bf313302b7ac6df416229ad26eaa52b1e22f2) add `client::spotify.rs` module implementing a Spotify client on top of `rspotify` client traits - [`5742edd`](https://github.com/aome510/spotify-player/commit/5742edd81bc8759dfa1614b71cea11aa49be5b91) add `client::handlers` implement event handling functions - [`e341aae`](https://github.com/aome510/spotify-player/commit/e341aae0c6d1e1679245400e6362fea7f45ed4af) rewrite majority of client's handling functions with `rspotify v0.11` - [`4c44d9c`](https://github.com/aome510/spotify-player/commit/4c44d9c9f3acaafe439e6b577e807025532c4fe8) modify `state::{Track,Album,Artist}` to ensure that the `id` field is not None ### 📊 Changes **21 files changed** (+2057 additions, -2623 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+612 -1181) 📝 `spotify_player/Cargo.toml` (+22 -21) 📝 `spotify_player/src/auth.rs` (+1 -1) ➖ `spotify_player/src/client.rs` (+0 -997) ➕ `spotify_player/src/client/handlers.rs` (+167 -0) ➕ `spotify_player/src/client/mod.rs` (+691 -0) ➕ `spotify_player/src/client/spotify.rs` (+149 -0) 📝 `spotify_player/src/connect.rs` (+11 -10) 📝 `spotify_player/src/event/mod.rs` (+25 -36) 📝 `spotify_player/src/event/popup.rs` (+37 -41) 📝 `spotify_player/src/event/window.rs` (+62 -66) 📝 `spotify_player/src/main.rs` (+7 -11) 📝 `spotify_player/src/state/mod.rs` (+1 -1) 📝 `spotify_player/src/state/player.rs` (+204 -177) 📝 `spotify_player/src/state/ui.rs` (+9 -11) 📝 `spotify_player/src/token.rs` (+18 -32) 📝 `spotify_player/src/ui/context.rs` (+16 -15) 📝 `spotify_player/src/ui/mod.rs` (+7 -8) 📝 `spotify_player/src/ui/popup.rs` (+2 -2) 📝 `spotify_player/src/ui/search.rs` (+1 -5) _...and 1 more files_ </details> ### 📄 Description ## Brief description of changes - upgrade the application's dependencies: - `rspotify` to `v0.11.2` - `librespot` to `v0.3.0` (now a single library instead of multiple `librespot-*` libraries) - and other dependencies - remove `client.rs` and replace with a `client` folder module, which includes: - `client/mod.rs`: consists of `client::Client`'s definition and its method implementations - `client/handlers.rs`: consists of functions that handle player events, client requests, etc - `client/spotify.rs`: consists of `client::Spotify`'s (a client to interact with Spotify APIs) definition and its method implementations - rewrote majority of client functions' implementations in `client/mod.rs`: - switch to `rspotify`'s async functions - simplify the handling logics - integrate `rspotify` type-safe item's ID (`TrackId`, `AlbumId`, etc) - require `state::{Track,Album,Artist,Playlist}` to be always in a valid state (having a valid `id`). In other words, parsing from a `rspotify`'s item can possible be fail (e.g `rspotify::SImplifiedAlbum` to `state::Album`) - replace `get_X` method in a struct with `X` to follow idomatic Rust --- <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:53 +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#576
No description provided.