im85288 / service.upnext

GNU General Public License v2.0
81 stars 42 forks source link

Kodi crashes when attempting to play next episode #250

Closed LionelA64 closed 2 years ago

LionelA64 commented 3 years ago

At the end of an episode, the Up Next pop-up will appear but when it loads the next episode, the video will load for a while (but won't play) then Kodi would ultimately crash. I am experiencing the issue on Android TV 9. Oddly enough, I cannot reproduce the bug on Windows 10 and Android. I use PlexKodiConnect for my library by the way.

Using PlexKodiConnect 3.0,13 and Up Next 1.1.5 on Kodi 19 Matrix.

Here's the log: kodi.log

MoojMidge commented 3 years ago

Looks like this issue coming up again: https://github.com/croneter/PlexKodiConnect/issues/923

The reason why this occurs is because the UpNext data sent from PKC is not being decoded after being encoded and converted to a hex string for use by internal Kodi functions. By the time the data gets back to UpNext, it can't do anything with it, and therefore tries to playback the next video like it was a normal library item.

Few things to fix:

  1. Better error handling in UpNext, to catch bad data being sent from an addon
  2. Fix PKC - https://github.com/croneter/PlexKodiConnect/blob/python3/resources/lib/kodimonitor.py#L594-L595
    data = binascii.hexlify(json.dumps(info).encode('utf-8'))
    data = '\\"[\\"{0}\\"]\\"'.format(data)

    should be something like

    data = binascii.hexlify(json.dumps(info).encode('utf-8'))
    data = '\\"[\\"{0}\\"]\\"'.format(data.decode('ascii')
croneter commented 2 years ago

Should finally be fixed with PlexKodiConnect version 3.6.1