-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Weirdness with Playlists #133
Comments
Multiple different issues that are almost surely not related. But given that most of them can't be helped here, we can handle them all in one issue. For the first one, I can't replicate it. I'm not sure how you're accessing Muse or how that client specifically retrieves data from the mopidy instance (I don't see any relevant information in the network inspector), but it appears to be working just fine for me when I'm accessing it directly over The second issue I believe you've already narrowed it down to being a server side issue, not client side. We just play whatever the server hands us in that case. Play queue not clearing when something else is chosen to play - I've gone back and forth on this. It probably makes more sense to clear the play queue unless the "play next" or "add to queue" buttons are clicked. "Clear queue" button - This appears to be by design(?). I don't receive any commands from the server, nor do I see any api calls happening when that button gets clicked, so I suspect it only applies to the queue in the web player. ie: it's entirely client side to web and doesn't go through the server at all, so it can't control remote controlled clients. |
Thanks for the reply! Is there anything I can do to capture debugging info for the first issue, or to help track it down? For what it's worth, the behavior has now changed; instead of permanently loading, I now also have a Agreed on clearing the queue unless "play next" or "add to queue" are clicked. That would be in line with other players. I also forgot to mention that the repeat button in Jellyfin doesn't propagate to Mopidy. But that may be a similar situation to the Clear Queue button. |
You can get more logging by running Both Shuffle and Repeat from the web interface don't send any commands that I can pick up on the client side. |
Hi, I do indeed have playlists visible in Jellyfin. Quite a few of them, in fact. They work, subject to the ordering problem I described when casted. They were imported from m3u files from a previous system. I tried this in my mopidy.conf which should produce even more output:
Now, when clicking on the playlists tab, I get:
Weird, I thought. Something must be cached, since I restarted Mopidy. /var/cache/mopidy had only jellyfin/token which didn't seem like a likely culprit. I found Now clicking on the Playlists tab caused the same "loading..." as before. The log after clicking is this:
Not very helpful, it seems. I'm not seeing anything here about communication back to Jellyfin. So I thought I'd see what would happen if I'd go to Browse->Jellyfin. There I saw:
10.200.0.73 is my Jellyfin server, so there was a hit back to the Jellyfin system. So perhaps the Playlist tab isn't actually hooked up to do anything? |
Except it's working for me, so there's something specific to your setup that's causing this to not work. Playlists are loaded from the server immediately upon mopidy starting, and periodically refreshed. So basically right after you start mopidy you should see output of it requesting data from the server (like you're seeing in that last code block while browsing. Anything with Run From there we can get into the extension files themselves. Edit raw_playlists = self.backend.remote.get_playlists()
logger.info(f'raw_playlists: {raw_playlists}') ############################ NEW LOG LINE
if raw_playlists:
for playlist in raw_playlists:
logger.info(f'Working on {playlist.get("Name")}') ################ NEW LOG LINE
playlist_id = playlist.get('Id')
playlist_uri = 'jellyfin:playlist:%s' % playlist.get('Id')
contents = self.backend.remote.get_playlist_contents(
playlist_id
)
# Create local Mopidy tracks for audio and book files
tracks = [
self.backend.remote.create_track(track)
for track in contents if track['Type'] in ['Audio', 'Book']
]
# Only create a playlist if it has valid tracks
if tracks:
logger.info('Found tracks') ################################## NEW LOG LINE
playlists[playlist_uri] = Playlist(
uri='jellyfin:playlist:%s' % playlist.get('Id'),
name=playlist.get('Name'),
tracks=tracks
)
else: ############################################################ NEW LOG LINE
logger.info('Playlist has no audio tracks') ################## NEW LOG LINE
else: #################################################################### NEW LOG LINE
logger.info('No Playlists found in the server') ###################### NEW LOG LINE Remove your extra verbosity in the config file and restart mopidy. If it finds any playlists in the server, this will tell us. |
Interesting. I made the change, and:
So I instrumented remote.py:get_playlists() a bit. I saw this:
So, I wondered, why does jellycli get the playlists when talking to the same server with the same user? Over at https://github.com/tryffel/jellycli/blob/master/api/jellyfin/item.go#L356 I see it is requesting |
So, it sounds like the root of the issue here is that you have plenty of playlist objects, but don't have a playlists library yet. For some reason importing m3u files doesn't actually create the library/give you full access to it. You have to create/modify a playlist in the UI for it to appear. I suspect you also don't have Playlists on your home screen along the top with all your other libraries (I mentioned this previously), which would be the main sign of this being true. There's no real reason I can't change the code here to look strictly for playlist objects instead of a playlists library, it just haven't been an issue and this way made sense when I was writing it initially. |
Thank you! I guess I misunderstood what you meant. I created a new playlist in Jellyfin and now I do have a Playlists item under My Media, next to Music. (in addition to the Playlists tab at the top of the Music screen, which is what I thought you meant). My apologies for misunderstanding. It is seeing the playlists now! I need to do some more testing, but initially it seems like it may have also improved the out-of-order issue. |
One new item: when refreshing playlists in Iris, I get a bunch of these logged:
The playlists all show up, and initially show up with 0 tracks, but when opening a playlist, everything loads OK. So to summarize, the things I'm seeing that would still be helpful:
THANKS again for all your work on this & help! |
The URI log messages appear to be (another) quirk of how Iris uses the api and requests data. The seem to be querying each individual playlist instead of asking for all of them at one time. I can make another special case for them which should make the log messages go away and the client work slightly nicer. |
Hello,
Thank you for this extension!
I have two issues with it, which I'm not sure are related:
A possibly-related niggle: when I ask Jellyfin to cast an album to Mopidy, it doesn't clear Mopidy's play queue, just adds to it. Also the "Clear queue" command from Jellyfin does nothing.
Thank you!
The text was updated successfully, but these errors were encountered: