1
0
Fork 0
mirror of https://github.com/librespot-org/librespot.git synced 2025-10-03 01:39:28 +02:00
librespot/connect/src
Jay Malhotra df5f957bdd
refactor: Introduce SpotifyUri struct (#1538)
* refactor: Introduce SpotifyUri struct

Contributes to #1266

Introduces a new `SpotifyUri` struct which is layered on top of the
existing `SpotifyId`, but has the capability to support URIs that do
not confirm to the canonical base62 encoded format. This allows it to
describe URIs like `spotify:local`, `spotify:genre` and others that
`SpotifyId` cannot represent.

Changed the internal player state to use these URIs as much as possible,
such that the player could in the future accept a URI of the type
`spotify:local`, as a means of laying the groundwork for local file
support.

* fix: Don't pass unknown URIs from deprecated player methods

* refactor: remove SpotifyUri::to_base16

This should be deprecated for the same reason to_base62 is, and could unpredictably throw errors -- consumers should match on the inner ID if they need a base62 representation and handle failure appropriately

* refactor: Store original data in SpotifyUri::Unknown

Instead of assuming Unknown has a u128 SpotifyId, store the original data and type that we failed to parse.

* refactor: Remove SpotifyItemType

* refactor: Address review feedback

* test: Add more SpotifyUri tests

* chore: Correctly mark changes as breaking in CHANGELOG.md

* refactor: Respond to review feedback

* chore: Changelog updates
2025-09-11 19:59:53 +00:00
..
state refactor: Introduce SpotifyUri struct (#1538) 2025-09-11 19:59:53 +00:00
context_resolver.rs Adjust: Allow repeat in combination with shuffle (#1561) 2025-08-31 20:32:01 +02:00
lib.rs Add rustdoc to connect crate (#1455) 2025-02-22 23:39:16 +01:00
model.rs Re-Add ability to handle/play tracks (#1468) 2025-05-04 20:29:54 +02:00
shuffle_vec.rs Adjust: Allow repeat in combination with shuffle (#1561) 2025-08-31 20:32:01 +02:00
spirc.rs refactor: Introduce SpotifyUri struct (#1538) 2025-09-11 19:59:53 +00:00
state.rs Adjust: Allow repeat in combination with shuffle (#1561) 2025-08-31 20:32:01 +02:00