-
Notifications
You must be signed in to change notification settings - Fork 22
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
Current song not displayed right after Spotify launch #28
Comments
Yeah I know about this one, though I'm not sure what's causing it. For some reason, until you change the song, the I thought I'd broken it with a commit, but I don't think I touched that part of the code. I'm still getting the metadata the same way I always have, but now it works different somehow. Could be related to the latest Spotify version. I know for a fact that they did make some changes to their Dbus interface (see #22), this could be a side effect of those. |
I have finally found the time to investigate this, and managed to find a solution, which is admittedly a bit hacky, but seems to work okay. The problem seems to be that, at the moment Spotify launches, the extension picks up Spotify's DBus properties faster than Spotify can populate them. I don't know how that works, but that's the only explanation I can give. If you query that information the moment Spotify's name appears on DBus, you get incomplete values. But if you wait just a little bit, you get everything. So that's what I did. I've added a couple hundred milliseconds of delay to the instantiation of the spotify dbus proxy. It now has all the correct values when Spotify is launched. I don't love the solution, as arbitrary time delays like that are not very reliable or portable, but that's the only thing that has worked so far. I'll probably push a new version with the fix today, tomorrow at the latest. |
Hey @esenliyim, Great news! Another idea though, maybe silly, you tell me: you may also requery every x ms the DBus, as long as the information is not complete. The delay between this queries will also be arbitrary, but at least, you can make sure it ends up with the information, will it come after 200ms or 7s. If you prefer, i can wait for your branch, PR or commit to show up and give myself a try when i have the time. What you did is a win in any case! Spotting the reason of an issue is often the most complicated! ^^ |
Yeah that's actually what I'm doing. If the artist-title-album trio is all set or is all unset, I go ahead and create the proxy. The reason I accept their all being unset is because that's a normal state for Spotify to be in. Happens when you first launch the application after installing it, or sometimes updating it, for example. If the trio is partially set, I retry 4 more times before breaking the loop and just creating the proxy with incomplete values. |
Pushed it, finally. Now at the very start it displays the ⏹️ icon, but the correct metadata is there under the hood. When you start playing it should show the correct stuff. I've done my own testing on two different computers and it seems to be working fine. Let me know if there are issues. |
Great! I'll test that on my side soon and let you know if it fixed it too. |
Hi @esenliyim, I had a chance to test it today, and globally it works great. I have two concerns though.
|
I'm not sure I understand the problem with 1). As in, I don't understand the situation that causes it. The label fails to replace the placeholders during playback after switching audio interfaces? That's weird. I'd love to see what the gnome-shell logs show when that happens, if anything. And I agree with the stopped icon. Good news is, that's just a stopgap measure for the time being. I won't be updating the extension on the website without an option to change it. The loop/shuffle icons too. |
@esenliyim I managed to reproduce 1) just now, staying on speakers, just by launching/exiting Spotify multiple times in a row. I'm not sure where I can find the gnome-shell logs you are asking me about. I'd be glad to capture them for you. |
I'll try doing that on my end. To watch the logs I use the command |
This one looks better: https://youtu.be/uuaeoWelcYg |
Right. I managed to recreate it by restarting Spotify over and over. Sometimes it does fail to display correct information, but it goes back to normal after restarting again. I think my way of deciding when I've got "good" metadata from DBus is flawed, and sometimes the extension thinks it got it when it didn't, in fact, got it. Must investigate. edit: Yes, I have confirmed that is indeed the case. |
I am still encountering this issue, was it supposed to be fixed? |
Oh right. I did fix it and then uploaded the fixed version. It got rejected because of a dumb mistake on my part but I couldn't get on it right away and then things happened in real life and I kinda forgot about it, which is kinda embarrassing. Thanks for reminding me. I'll upload it as soon as I can, an update should be available soon. |
Haha no worries, all good, it's not a deal breaker! Great gnome extension no matter what ;) |
It's out and approved now. I made it so the song title isn't actually displayed until you start playback for the first time after launching Spotify. That was a conscious decision on my part, to make compatibility with 3rd party clients simpler. The data should be correctly shown once playback starts, though. |
For some reason, it seems this is still not fixed, using v17. 🤔 |
Interesting. I'm gonna need you to help me help you then, because it's working fine for me on two different systems. There's no fixed local version that I haven't pushed either. Does it fail after every launch, or just sometimes? What do the gnome-shell logs say when it does fail? |
Hi @esenliyim,
I wanted to report to you a small bug, that I could not pinpoint yet.
After opening Spotify, the current song, also being the one played on the last session is not displayed properly, even if I play/pause it.
The sole way to recover the information is by going to another song. At this point, it will never fail to display info anymore.
But if I close completly Spotify and open it again, the problem obisoulsy comes back.
A quick video to illustrate it: https://youtu.be/czs4Dfh1Zc8
The text was updated successfully, but these errors were encountered: