-
Notifications
You must be signed in to change notification settings - Fork 627
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
Spirc: Replace Mecury with Dealer #1356
base: dev
Are you sure you want to change the base?
Conversation
1718360
to
959993a
Compare
oh the branch might not compile because there are still some |
Super job! I know you're not there yet, so let's all contribute here. Stuff like this almost makes me sign up for a Spotify plan again 😉 I'm gonna have a more thorough look later. Wanted to ping back on your comment over at #1349:
If you look at I think if you follow the code flow, updating the connection ID then triggers the
|
- impl shuffle again - extracted fill up of next tracks in own method - moved queue revision update into next track fill up - removed unused method `set_playing_track_index` - added option to specify index when resetting the playback context - reshuffle after repeat context
And with that the search result we resolve, should now expect the result from the search in each client. Additionally i could cleanup a workaround for the single track and autoplay context :D Thx again for reporting the issues^^ |
Hey @photovoltex, the re-sorting of the liked songs is indeed working now. Playing a single song from search also works now. 👍 However:
Maybe these two issues are related because I think you don't have a search context when trying to play from "Recent searches", idk. I tested all of this only on Android. |
I would actually say the behavior of librespot is not wrong. But yeah web-player and android seem to not actually play from the search context. Just checked what happens If we would run into autoplay for the search and it seems to fail. So I will rewrite it so that we always just play the track provided by a search. Seems easier anyways after implementing the other solution xD. But mobile really is a special client for the dealer implementation... |
- handle logout command - disable support for logout - add todos for logout
I disabled logout support for now, because there is no proper logic in place to logout from a session. We could solve that afterwards, but for now it should probably stay disabled so it doesn't get in the way of merging these changes^^ |
very nice work @photovoltex! playing from recent searches works now. this PR also seems to fix #1205 then :D just noticed one small bug introduced with the latest changes: if you play a song from recent searches or search, then everything looks fine, you can click the queue, shuffle and repeat buttons: |
That's an intended behavior because you switched to the autoplay context. We could probably argue if it makes sense to disabled the queue (don't even know exactly why that happens). But I would argue shuffle and repeat don't make much sense when you are playing an infinite context. |
Ah, I didn't knew that. Also somehow did not notice it while testing xD
The only reason I could come up with why repeat could be useful is that you would be able to repeat a single song that is in the queue. Also, the normal behavior of the Spotify app when not connected to librespot is to disable the repeat and shuffle buttons but leave the queue button enabled. |
I would probably also agree to mimic the behavior. I mean that's why shuffle and repeat is already disabled :D. Will look later into it why the mobile version disables the queue. In the web-player you can do that at any point so I think it might be a mobile specific behavior again. |
- always allow next - handle no prev track available - separate active and fill up context
- transfer into autoplay again
I adjusted the handling yet again on that part. It might now hopefully behave similar to the other clients. Additionally i fixed the weird behavior when going to the previous track, without there being a prev track. There is a restriction set, that technically forbids the client to do it anyways... but mobile does seem to ignore it :D
|
@photovoltex The behavior seems to be (almost) the same as on the official clients now - the buttons get grayed out except for the queue button. Very nice :D I can also say now that the UI autoplay switch is also ignored when using the Android app. autoplay only works when forcing via
Also, when autoplay is turned off, I see these errors when selecting a song from search:
skipping to the next song then causes these errors (i think skip should be disabled when there are no songs left in the queue):
it also seems like that the Android app loads the autoplay recommendations differently than librespot. The app loads the recommended songs after skipping to the next song. Librespot directly loads them when clicking on a search result. I think that these different behaviors cause the following bug: if autoplay is on, you already selected a song before connecting to librespot, did not skip to the next song and then connect to librespot, you get these errors after connecting:
also, skipping to the next song does not work (because there is no queue available). this error gets logged:
|
The info is still retrieved via mecury. In the future we probably would want to switch to the ucs info retrieval. I also saw that behavior before, while testing but currently it does seem to send the data as expected. Funnily enough, for myself autoplay sometimes is enable and sometimes not, even tho I didn't change if autoplay was enabled or not.
Ugh, that's not so good. Already got to reproduce it. Don't know why that didn't occur when i testing. Will look into it.
Before these changes it was disabled, but it did feel a bit wrong to not be able to skip to the next track. I will adjust the logging messages accordingly.
Huh... I looked into it what the mobile client actually send... For the first played track from the search it sends 40 tracks all delimited by delimiter-tracks. So in total 80 tracks. Anyhow meaning we probably just need to add a delimiter and the mobile client should display our content as expected. I also tested if the mobile client without autoplay would maybe play the search-context, but no. It just stops after skipping to the next tracks. |
- unify naming - move more metadata infos into metadata.rs
- improved certain logging parts - preload autoplay when autoplay attribute mutates - fix transfer context uri - fix typo - handle empty strings for resolve uri - fix unexpected stop of playback
@photovoltex now the recommendations load exactly the same as in the Android app. That means #1205 can now definitely also be closed when merging this PR :D Unfortunately I noticed a new bug since the last update (which was not there before I updated):
This seems to only happen when playing a song from recent searches, I could not reproduce it otherwhere (not even in the normal search). |
- uid getting replaced by empty value - shuffle/repeat clearing autoplay context - fill_up updating and using incorrect index
Funnily, that is one of the issues I encountered myself, but ignored it with the reasoning of "it's probably just a development state that will not happen in the wild :^)" I tried a bit around, fixed some other incorrect states and behavior but didn't find a way to mitigate the issue regarding transferring the playback to the mobile app. I would suspect that it has to do with some incorrect state. Will try to find a solution the next days. Big thanks again for all the testing and additional issue reports^^ |
As suggested from @roderickvd a draft PR so i can have some community feedback and give now and then updates on the progress.
The replacement is in a working state, so the very basic do work again. There is still a lot of cleanup and re-implementing to do.
But so far what is working:
Known Problems:
might be that that is already resolved, but i think i still saw that behavior not so long agoWhat i still have to do:
currently it works really well if the playback starts from a different device like the web-playerbut from a cold start it's still a bit weird and not fully sorted outI tried to keep my code clean, but if there are points that i could improve and such, i would like to here them^^