Skip to content
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

Jellyfin for Kodi - shows pop up but never plays next episode #313

Closed
Schaka opened this issue Aug 8, 2024 · 7 comments · Fixed by jellyfin/jellyfin-kodi#899
Closed

Comments

@Schaka
Copy link

Schaka commented Aug 8, 2024

Unfortunately, on my Ugoos AMB6 Plus running CoreELEC with Kodi 21.0, the plugin doesn't work.
Kodi just shows the preview correctly and once I click on it to play the next episode, I see a pop up in the top right that the playlist item couldn't be found and nothing happens.

Playlist

Can't find a next item to play

Kodi: 21.0
Jellyfin: 10.9.9
Jellyfin for Kodi: 1.0.4

I already resetting my entire library through the Kodi addon. It did work once (literally once on a single episode) but I haven't been able to reproduce it at all since. On a clean install of Kodi on Windows, it works just fine. In Windows, I can see both episodes in the playlist for a short while after starting the next one before it gets removed. It seems on my Ugoos this never happens.

I've tried messing with a bunch of settings to see if I can get it to work somehow, but have had no success.
The relevant log should be around 19:33.

kodi.log

Edit: I tried on the main profile on the default skin and it works. I'm trying to see if I can confirm it's directly related to Arctic Horizon 2.

@MoojMidge
Copy link
Collaborator

I don't know how Jellyfin for Kodi is meant to work, but the way it interfaces with Up Next has been broken by this change:
jellyfin/jellyfin-kodi@57ed8bd#diff-ae956997a41d38fa480375de89696dfae577053ce1a9996a24bab884ffc94063R122

Can't just convert from bytes to str like that, as that just creates a representation of the bytes object rather than actually converting it. Have to provide an encoding when call str() or decode the bytes object.

Because Up Next can't make any sense of what the Jellyfin for Kodi plugin is sending it, an exception is thrown and it just tries to play the Jellyfin plugin url that the Jellyfin plugin has added to your library, but that also doesn't seem to work for some reason. That is why you then get the "Can't find a next item to play" error.

Suggest you create an issue with the Jellyfin team. You can point them to explanation above.

@oddstr13
Copy link

Good spot @MoojMidge, thank you! 😄
Must've been an oversight from the py2->py3 migrations.

@Schaka: Should be fixed with jf4kodi v1.0.5, but if you're still having problems, please create a new issue on our tracker.
(I didn't test Up Next functionality, only fix the issue pointed out here)

@MoojMidge
Copy link
Collaborator

@oddstr13 - no problem

Should be fixed with jf4kodi v1.0.5, but if you're still having problems, please create a new issue on our tracker.

That was a quick turnaround! The log that was posted indicated that even with the error, the plugin://plugin.video.jellyfin urls in the Kodi library are attempted to be played, but this does not work for some reason. Is there something else that needs to be done to trigger playback from a plugin like this?

@oddstr13
Copy link

I am not entirely sure of how those parts would work, I opened a issue to track the question on the jf4kodi repo, but I'm not sure of when I'll get around to do a deep dive into it.

Quick turnaround is due to a few reasons, but I do releases whenever I feel like there is something worth releasing, and when I have time and motivation to do it, I just happened on the conversation pointing to this issue in my mail inbox, and the issue you pointed out was a 5min fix. I consider jf4kodi "stable", so there's not exactly that many moving parts on the repo, so bugfixes can be streamlined fairly quickly with the help of the release CI – when there is time and motivation that is 😅

@Schaka
Copy link
Author

Schaka commented Aug 12, 2024

Ironically, the bug is back now (on Windows) with other skin.

I added the skin to my Windows install and Up Next pop up wouldn't show anymore.
After that, I went back to Jellyfin 1.0.4 - it now shows again. Howeve,r the error is as described in the OP.
Going back to Jellyfin 1.0.5 doesn't seem to have solved this.

Restarting Kodi made the pop up just not appear again. Going back to 1.0.4, then restarting, makes the pop up appear (Arctic Fuse, Arctic Horizon) but error in the OP still occurs.

The log here is specifically only of after I went back to 1.0.4 and tried out Up Next. This is something that was working previously without issue.
kodi.log

I'll happily get you guys some debug logs, I would just need to know what to do exactly, as I'm unsure which chain of actions would be helpful.

@oddstr13
Copy link

Well the particular relevant issue I fixed here would've resulted in upnext not parsing the data since Kodi 18, so how or if this even worked since then and up to now I have no idea.

"b'48656c6c6f2c20576f726c6421'" is not a valid hex string no matter how you look at it

def decode_data(encoded):
"""Decode data coming from a notification event"""
encoding = 'base64'
from binascii import Error, unhexlify
try:
json_data = unhexlify(encoded)
except (TypeError, Error):
from base64 import b64decode
json_data = b64decode(encoded)
else:
encoding = 'hex'
# NOTE: With Python 3.5 and older json.loads() does not support bytes or bytearray, so we convert to unicode
return json.loads(to_unicode(json_data)), encoding

I'll need a new issue on the jf4kodi repo, with logs for 1.0.5

1.0.4 is broken for certain, I have no idea why 1.0.5 isn't working for you.

Could be we're sending incorrect data in the event, but I don't know.
We should be seeing this line log some info in 1.0.5:

self.log('addon_data_received called with data %s' % data, 2)

If there are only specific skins that don't work, then I'd need to know what those expect, if that is where the issue is located.

@Schaka
Copy link
Author

Schaka commented Aug 13, 2024

Of course, as luck would have it, going back to 1.0.5, restarting Kodi again with debug logging and testing it, the popup showed no problem and worked, whereas before it wasn't even appearing at all anymore.

I'll create an issue over at jf4kodi if I can ever reproduce it reliably. Thanks for all the help so far!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants