-
Notifications
You must be signed in to change notification settings - Fork 489
Update librespot to fix #1356 / #1358 #1360
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
Conversation
Change default to 50 per librespot change here, which defaults to 50
|
thanks for starting this! wanted to give it a try, but it doesn't compile with MPRIS support :( |
Not surprised 😅 I should clarify this built for me with whatever |
|
here is a patch file which make mpris compile and work for me (playerctl controls, metadata etc. works). Also switched oauth so the deprecation warning goes away. Now for my compile flags no warnings. I suggest you add it as a commit to your PR. fixed_mpris_and_oauth_warning.PATCH DISCLAIMER: I am a sw engineer but I don't know rust nor librespot (c++ guy). This was mostly vibe-coded by giving GPT-5 the breaking changelog since last tag + access to librespot master. So yeah, should be considered just as a starting point. |
|
Thanks for this hotfix! I've managed to get up and running again thanks to your MR. |
eladyn
left a comment
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.
Thank you for your effort!
The code so far looks mostly good to me; I added some small review comments.
I'm not entirely sure if we should be using an untagged dev version of librespot; I'd probably need to do some proper testing. Considering that a quick workaround (blocking apresolve.spotify.com) also works very well, I would tend towards waiting for librespot to do a release, but I'd also be open to releasing it earlier.
src/process.rs
Outdated
| env.insert("REPEAT", format!("{:?}", context)); | ||
| env.insert("REPEAT_TRACK", format!("{:?}", track)); |
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.
To be in line with the previous behaviour, maybe something like
| env.insert("REPEAT", format!("{:?}", context)); | |
| env.insert("REPEAT_TRACK", format!("{:?}", track)); | |
| let val = match (context, track) { | |
| (_, true) => "track", | |
| (true, false) => "all", | |
| (false, false) => "none", | |
| } | |
| .to_string(); | |
| env.insert("REPEAT", val); |
could work? (not tested)
src/process.rs
Outdated
| env.insert("PLAYER_EVENT", "filterexplicit_changed".to_string()); | ||
| env.insert("FILTEREXPLICIT", filter.to_string()); | ||
| } | ||
| PlayerEvent::PositionChanged { .. } => todo!(), |
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.
todo!() will crash the application, when this line is reached, so it should generally not be in production code.
In our case, since we never activate this signal, we shouldn't receive this event at all and could either do unreachable!("this event is not enabled") (which would also crash the application, but communicates the purpose more clearly) or just add it as a second case to the Seeked branch like so:
PlayerEvent::Seeked {
play_request_id,
track_id,
position_ms,
} | PlayerEvent::PositionChanged {
play_request_id,
track_id,
position_ms,
}Both would be fine to me, but the first one sounds like the cleaner solution.
I tend to agree as well, I did tag it to the specific commit that fixed the issue but I think even then it'd be more appropriate to wait for a librespot release, as I said in the OP this was more to provide a patch for users in the meantime/provide a working base, this is basically my only rust development ever and much like the above commenter was done with GPT + reading compiler warnings, so I'm sure much of it is nonsensical (like the usage of |
|
building it with the patch ( |
|
Went ahead and converted the PR to a draft, forgot it was a thing to be honest lol, makes more sense for my intent with this PR per my last comment, though. |
|
Looks like librespot released their new version https://github.com/librespot-org/librespot/releases/tag/v0.7.0 |
|
Ho sorry @raku-cat I've missed this PR :/ |
No worries at all! Yours looks much better made, it was always my intention to close this PR in any case. |
As the title says, since spotify broke things with an api change as referenced in #1356 and #1358, a fix was implemented in librespot but it hasn't been versioned yet, so this pulls the commit that fixed it and I've done the minimum of what was needed to get things working considering the changes in librespot between 0.6 and now.
I'm far from a rust dev nor am I familiar with the inner workings of this project, I basically just brute forced based on compiler errors until it compiled, I can confirm it does build and launch, and the issue with the 500 errors is resolved without any host file tweaking.
I'm not expecting that this'll get merged, just getting the ball rolling.