Closed fmauNeko closed 3 years ago
Thanks @fmauNeko for both changes!
May I ask you for two changes?
track_uris
in a similar way to that one of the (deleted) uris.extend()
, so that it conforms to pep8 and the mopdiy formatting guidelines?return
and add an additional and playback == 'stopped'
to the if time_position is not None:
clause? I know, that the time_position =
might become redundant, but in my opinion that change would improve the readability of the code, since this is be the only position, where restore_state()
would returning prematurely. Alternatively the part time_position = …; if time_position …
could be put in a if playback != 'stopped': time_position …; if time_position …
clause.Would that be possible?
If you want, I can do these changes myself. Just tell me what you prefer!
Changes submitted, don't hesitate to tell me if there's still anything wrong !
Thanks! Highly appreciated!
Could you please change your nested list comprehension to something like:
... = [
x.y
for sublist in ...
for x in sublist]
which I believe is the common way to write long list comprehensions. Than it's ready to be merged!
Done !
I just merged you PR. Thanks for it!
I still have a questions (I haven't looked into it more closely): Isn't that a bug in mopidy's spotify implementation? (and your PR ‘just’ a workaround?)
@fmauNeko: In the new release, I would like to shed some light onto the reason, why this PR was needed. For this I would love to have the background information from above. May I ask you to have a look at my question? Thanks.
@fmauNeko: Since I have to received an explanation and background information, I have to remove this PR, because I do not really know, what it is doing. It's actually a pity, but I cannot support code, which I do not know or understand.
As soon as I get an explanation, I can integrate it again …
This repository has been moved to https://codeberg.org/sph/mopidy-autoplay/ and this one set to read-only.
Please continue at https://codeberg.org/sph/mopidy-autoplay/pulls/7
Hello !
I made 2 small changes to the
restore_state
functionThe first is to use library lookups instead of relying on playlist schemes to detect playlists from normal tracks, because it breaks with
spotify:
URIs (the scheme is registered in the playlist schemes, which means track URIs are processed as playlist URIs, preventing them to be added to the tracklist).The second is to return before seeking, because if
seek
is called when the playback state isstopped
, it will switch toplaying
, thus defeating the purpose of astopped
state.I also took the liberty to create an Arch AUR package at https://aur.archlinux.org/packages/mopidy-autoplay/ .
Have a good day !