-
Notifications
You must be signed in to change notification settings - Fork 790
Fix: use extended-metadata endpoint to acquire metadata #1622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: use extended-metadata endpoint to acquire metadata #1622
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors metadata retrieval to use the extended metadata API endpoint instead of the legacy metadata endpoint, fixing an issue where metadata didn't include audio files.
- Replaced the legacy
/metadata/4/{scope}/{id}endpoint with the/extended-metadata/v0/extended-metadataendpoint - Updated all metadata methods to accept
&SpotifyUriinstead of&SpotifyId - Removed the
SPCLIENT_FALLBACK_ENDPOINTconstant that was previously needed for the legacy endpoint
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| metadata/src/track.rs | Updated to pass full SpotifyUri to get_track_metadata instead of extracting the ID |
| metadata/src/show.rs | Updated to pass full SpotifyUri to get_show_metadata instead of extracting the ID |
| metadata/src/episode.rs | Updated to pass full SpotifyUri to get_episode_metadata instead of extracting the ID |
| metadata/src/artist.rs | Updated to pass full SpotifyUri to get_artist_metadata instead of extracting the ID |
| metadata/src/album.rs | Updated to pass full SpotifyUri to get_album_metadata instead of extracting the ID |
| core/src/spclient.rs | Refactored metadata methods to use the extended metadata API, changed signatures to accept &SpotifyUri, and updated get_extended_metadata return type |
| CHANGELOG.md | Documented the breaking changes and bug fix related to metadata retrieval |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
db5dddf to
0e55742
Compare
|
Great, saved my evening. Works nicely! |
|
Working in my 30s of testing. I'd still get multiple of the following messages per second (in debug mode): |
|
And works with my fork, too! |
|
Works pretty good for me. |
- Update spotify_id_to_playable_id to use SpotifyUri enum - Update lyrics method to extract SpotifyId from SpotifyUri Related: librespot-org/librespot#1622
|
I can also confirm this fix works as expected. I've successfully tested it with spotify-player v0.21.1. Since the
With those compatibility changes in place, this PR's metadata endpoint fix works perfectly. Spotify-player now successfully uses the I'm preparing a compatibility PR for spotify-player to ensure it's ready when the librespot dev branch changes land in a release. Thanks @photovoltex! |
@michaelherger I don't have such warnings, so this might be something on your end then? But I wont rule out that there is still something we need to fix later down the line. |
I also gave this a spin to see if I could reproduce the libmdns warnings @michaelherger mentioned:
What I saw:
So yeah, looks like those warnings are probably specific to certain network setups, as @photovoltex suggested. I couldn't reproduce them here, but thought I'd share just in case it helps! |
|
Thanks - I'll see whether I can find something. I'm using PiHole - maybe it's swelling a little too much. |
- Update Cargo.toml to use librespot from gui-wf fork (photovoltex-fix-broken-metadata branch) - Add SpotifyUri import to spotify_worker.rs - Replace SpotifyId::from_uri() with SpotifyUri::from_uri() in load and preload handlers - Update variable names from 'id' to 'uri' for clarity This change adapts ncspot to work with librespot PR hrkfdn#1622 which introduces the SpotifyUri type and fixes broken metadata endpoint issues. Related: hrkfdn#1732, librespot-org/librespot#1622
|
I just built it for my Raspberry and it works. Thanks @photovoltex and @roderickvd ! |
3ee0951
# Conflicts: # CHANGELOG.md # playback/src/config.rs
This comment has been minimized.
This comment has been minimized.
|
Thanks! I wonder why they removed the preview from https://spclient.wg.spotify.com/metadata/4/track/, it broke my app. Will use this solution! |
Fixes compatibility with librespot PR hrkfdn#1622 which changed the API from SpotifyId::from_uri() to SpotifyUri::from_uri(). Changes: - Updated src/spotify_worker.rs to use SpotifyUri instead of SpotifyId - Updated Cargo.toml to use librespot from official repository (merge commit a9122dcb from PR hrkfdn#1622) - Regenerated Cargo.lock with updated dependencies Fixes hrkfdn#1732 Depends on librespot-org/librespot#1622 (merged)
* fix: adapt to librespot SpotifyUri API changes Fixes compatibility with librespot PR #1622 which changed the API from SpotifyId::from_uri() to SpotifyUri::from_uri(). Changes: - Updated src/spotify_worker.rs to use SpotifyUri instead of SpotifyId - Updated Cargo.toml to use librespot from official repository (merge commit a9122dcb from PR #1622) - Regenerated Cargo.lock with updated dependencies Fixes #1732 Depends on librespot-org/librespot#1622 (merged) * Switch to 0.8.0 release * Update CHANGELOG * `cargo fmt` --------- Co-authored-by: Guilherme Fontes <[email protected]> Co-authored-by: Henrik Friedrichsen <[email protected]>
which includes the fix in librespot-org/librespot#1622
which includes the fix in librespot-org/librespot#1622
Fixes the Spotify integration by using Spotify's extended metadata endpoint, see librespot-org/librespot#1622 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2688>
Fixes the Spotify integration by using Spotify's extended metadata endpoint, see librespot-org/librespot#1622 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2695>
which includes the fix in librespot-org/librespot#1622
As noticed by @michaelherger in #1621 the metadata endpoint seems to be broken again and does not contain anymore the file data.
This changes uses the extended metadata endpoint instead, which currently still contains that data.
Fixes #1623, Fixes #1620