From bff6305d227b363c43dbeda81f54c9849e31edeb Mon Sep 17 00:00:00 2001 From: croneter Date: Thu, 23 Dec 2021 13:40:05 +0100 Subject: [PATCH 1/2] Fix Kodi add-on `Up Next` crashing by removing code that has become obsolete on the PKC-side --- resources/lib/kodimonitor.py | 58 ------------------------------------ 1 file changed, 58 deletions(-) diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index 76c02424..b26c5fef 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -104,8 +104,6 @@ class KodiMonitor(xbmc.Monitor): elif method == "System.OnQuit": LOG.info('Kodi OnQuit detected - shutting down') app.APP.stop_pkc = True - elif method == 'Other.plugin.video.plexkodiconnect_play_action': - self._start_next_episode(data) def _playlist_onadd(self, data): """ @@ -205,18 +203,6 @@ class KodiMonitor(xbmc.Monitor): json_item.get('type'), json_item.get('file')) - @staticmethod - def _start_next_episode(data): - """ - Used for the add-on Upnext to start playback of the next episode - """ - LOG.info('Upnext: Start playback of the next episode') - play_info = binascii.unhexlify(data[0]) - play_info = json.loads(play_info) - app.APP.player.stop() - handle = 'RunPlugin(%s)' % play_info.get('handle') - xbmc.executebuiltin(handle) - def PlayBackStart(self, data): """ Called whenever playback is started. Example data: @@ -363,10 +349,6 @@ class KodiMonitor(xbmc.Monitor): status['external_player'] = app.APP.player.isExternalPlayer() == 1 LOG.debug('Set the player state: %s', status) - # Workaround for the Kodi add-on Up Next - if not app.SYNC.direct_paths: - _notify_upnext(item) - if playerid == v.KODI_VIDEO_PLAYER_ID: task = InitVideoStreams(item) backgroundthread.BGThreader.addTask(task) @@ -574,46 +556,6 @@ def _complete_artwork_keys(info): info['art'][key] = '' -def _notify_upnext(item): - """ - Signals to the Kodi add-on Upnext that there is another episode after this - one. - Needed for add-on paths in order to prevent crashes when Upnext does this - by itself - """ - if not item.plex_type == v.PLEX_TYPE_EPISODE: - return - this_api = item.api - next_api = _next_episode(this_api) - if next_api is None: - return - info = {} - for key, api in (('current_episode', this_api), - ('next_episode', next_api)): - info[key] = { - 'episodeid': api.plex_id, - 'tvshowid': api.grandparent_id(), - 'title': api.title(), - 'showtitle': api.grandparent_title(), - 'plot': api.plot(), - 'playcount': api.viewcount(), - 'season': api.season_number(), - 'episode': api.index(), - 'firstaired': api.year(), - 'rating': api.rating(), - 'art': api.artwork(kodi_id=api.kodi_id, - kodi_type=api.kodi_type, - full_artwork=True) - } - _complete_artwork_keys(info[key]) - info['play_info'] = {'handle': next_api.fullpath(force_addon=True)[0]} - sender = v.ADDON_ID - method = 'upnext_data' - data = binascii.hexlify(json.dumps(info).encode('utf-8')) - data = '\\"[\\"{0}\\"]\\"'.format(data) - xbmc.executebuiltin(f'NotifyAll({sender}, {method}, {data})') - - def _videolibrary_onupdate(data): """ A specific Kodi library item has been updated. This seems to happen if the From 44585f265163652b051c90782664bc6ecfa93c5f Mon Sep 17 00:00:00 2001 From: croneter Date: Thu, 23 Dec 2021 14:12:33 +0100 Subject: [PATCH 2/2] Stable and beta version bump 3.6.1 --- addon.xml | 7 +++++-- changelog.txt | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/addon.xml b/addon.xml index e0ccd605..2c5fb659 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + @@ -93,7 +93,10 @@ Plex를 Kodi에 기본 통합 Kodi를 Plex Media Server에 연결합니다. 이 플러그인은 Plex로 모든 비디오를 관리하고 Kodi로는 관리하지 않는다고 가정합니다. Kodi 비디오 및 음악 데이터베이스에 이미 저장된 데이터가 손실 될 수 있습니다 (이 플러그인이 직접 변경하므로). 자신의 책임하에 사용하십시오! 자신의 책임하에 사용 - version 3.6.0: + version 3.6.1: +- Fix Kodi add-on Up Next crashing by removing code that has become obsolete on the PKC-side #1750 + +version 3.6.0: - versions 3.5.9 - 3.5.17 for everyone - Fix media not showing up in the library if Kodi masterlock has been activated. Kodi bugfix is also necessary, hopefully coming with Kodi 19.4, otherwise switch to Kodi 19.1 - Fix PKC sometimes selecting the wrong subtitle for direct paths diff --git a/changelog.txt b/changelog.txt index 1fb7f5bb..ade920ba 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ +version 3.6.1: +- Fix Kodi add-on Up Next crashing by removing code that has become obsolete on the PKC-side #1750 + version 3.6.0: - versions 3.5.9 - 3.5.17 for everyone - Fix media not showing up in the library if Kodi masterlock has been activated. Kodi bugfix is also necessary, hopefully coming with Kodi 19.4, otherwise switch to Kodi 19.1