-
Notifications
You must be signed in to change notification settings - Fork 461
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
New DBUS method: TransferPlayback #1162
Conversation
Thank you for the contribution! In general, looks like a good idea. I only just had a quick look and didn't look at the code properly yet, but one concern that I have, is that the interface we'd be adding that method to is Regarding the error you're receiving, I'm quite sure that this comes from |
Yes, i think this is good idea. Currently there are two DBUS interfaces
I will try to fix it. Also i found another error, when trying to call my new method after longer time (about 20 hours, service was running this whole time) i got |
Issue ramsayleung/rspotify#383 pull request ramsayleung/rspotify#384 |
Sounds good. To stick to a domain that the project actually "owns", maybe we could use
Oh, that's weird! I think I implemented auto-refresh for the tokens some time ago and the D-Bus things should only be called, when a non-expired token is available? No idea, what's happening there. Did you notice anything special logged in the output? |
….Controls, also copy VolumeUp and VolumeDown methods, which are not in MediaPlayer2 ifc specification.
I've pushed changes, for now i copied VolumeUp and VolumeDown methods, instead of moving them, to avoid breaking changes. I've also marked those methods on
I didn't notice anything else in logs, but i added logging of token expiration time, so i will know more when error repeats itself. |
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. Some comments, but apart from that: looks good!
Do we want to grab an actual domain name for the project? Seems useful in general, and for this specifically. I'd be happy to set that up if so. |
@eladyn It looks like token is not always refreshed. I added code to log token expiration time an got those logs :
Log time is UTC +1, so it's about 18 minutes past token expiration. |
@dzubybb Oh, right. This took me a bit, to figure out! What's happening here, is that we spawn our dbus handling logic on a separate tokio task. This way, our main logic isn't blocked by those sync http requests (maybe there are other reasons as well, I don't know), but this also means that our token refresh logic is not run, when there's activity in the dbus server, but only, when there are new events for our PropertiesChanged signal. That is, why it was always working for me and for you it regularly failed: I only tested the behaviour with I'm not yet sure, what an elegant solution to this might look like, and I'm likely not going to get to it in the next few days, but now we have at least identified the root cause. Apart from that, I hope that get around to taking a look at your updated code in the following week. |
@slondr Sorry for not replying earlier! In general, I like the idea of having a proper domain for My concern in that regard would be, that as soon as such a domain is established, dependencies on that domain will be popping up (e.g. usage of it as DBus name, linking to it in README, issues and other resources). Some of these are reverted more easily than others, so such a decision shouldn't be made light-heartedly, and the ones taking responsibility for the domain should be aware of the possible implications. But if you'd like to take up that challenge, I won't be stopping you. :) |
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.
Some minor comments, other than that, this looks good to me. And it's working nicely as well!
Oh it's no big deal for me, I have close to a dozen domains already that I don't even do anything with (but definitely will one day! I swear!), so adding 1 to the pile is fine. Looks like I can grab spotifyd.rs for like $25 a year! |
Code fixes done. I also added setter for Shuffle property. Should i commit it here, or open new pull request for that ? |
Thanks, it only seems that you missed one item? Or was this intentional / doesn't work like that?
Oh, that's great! I think, opening a new pull request should make it easier to review / allow us to merge this one earlier. It would be totally fine by me, as well, if you just based that second PR on the changes in this one. This way, you don't have to go through the hassle and rebase them on master. |
Right, forgot about that, pushed. |
Damn, pushed too much :) |
So... how do i do that ? Just create another PR from same master branch in my fork ? |
You can create a new branch from the current commit on your master branch, add your changes and push that branch to your forked repo. Then, you should be able to create a new pull request from this second branch into this repo's master. |
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.
Two little last things that I missed previously. After that, I think we're good to go!
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! LGTM and works fine.
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.
epic
This is a new TransferPlayback method available for DBUS. It's useful in my setup where spotifyd is part of audio system based on dietpi micro computer. It's used to transfer playback from other active spotify device.
Also i discovered weird error when setting my spotifyd device type to S_T_B. It was returned from device() method of spotify client as STB (all capitals) and was throwing error:
I didn't find
STB
anywhere in code so i assume that spotify changes that somehow ?