From 5b5af1ceed6fe020ee810e0c69d6a95e09cc1164 Mon Sep 17 00:00:00 2001 From: croneter Date: Sat, 19 Jan 2019 16:56:10 +0100 Subject: [PATCH] Fix browsing to show from info dialog - Fixes #603 - Increases dependency on plugin.video.plexkodiconnect.tvshows to 2.0.8 --- addon.xml | 2 +- resources/lib/kodimonitor.py | 6 ++++++ resources/lib/playback_starter.py | 20 -------------------- resources/lib/service_entry.py | 3 --- 4 files changed, 7 insertions(+), 24 deletions(-) diff --git a/addon.xml b/addon.xml index 259b59e2..2394b256 100644 --- a/addon.xml +++ b/addon.xml @@ -5,7 +5,7 @@ - + video audio image diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index 9eaf5af1..41cd0a57 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -89,6 +89,12 @@ class KodiMonitor(xbmc.Monitor): _playback_cleanup() app.SYNC.suspend_sync = False elif method == 'Playlist.OnAdd': + if 'item' in data and data['item'].get('type') == v.KODI_TYPE_SHOW: + # Hitting the "browse" button on tv show info dialog + # Hence show the tv show directly + xbmc.executebuiltin("Dialog.Close(all, true)") + js.activate_window('videos', + 'videodb://tvshows/titles/%s/' % data['item']['id']) with app.APP.lock_playqueues: self._playlist_onadd(data) elif method == 'Playlist.OnRemove': diff --git a/resources/lib/playback_starter.py b/resources/lib/playback_starter.py index 691cc634..a6f67804 100644 --- a/resources/lib/playback_starter.py +++ b/resources/lib/playback_starter.py @@ -4,15 +4,11 @@ from __future__ import absolute_import, division, unicode_literals from logging import getLogger from urlparse import parse_qsl -import xbmc -from .kodi_db import KodiVideoDB from . import playback from . import context_entry -from . import json_rpc as js from . import pickler from . import backgroundthread -from . import variables as v ############################################################################### @@ -52,22 +48,6 @@ class PlaybackTask(backgroundthread.Task): playback.process_indirect(params['key'], params['offset'], resolve=resolve) - elif mode == 'navigation': - # e.g. when plugin://...tvshows is called for entire season - with KodiVideoDB(lock=False) as kodidb: - show_id = kodidb.show_id_from_path(params.get('path')) - if show_id: - xbmc.executebuiltin("Dialog.Close(all, true)") - if v.KODIVERSION >= 18: - js.activate_window('videos', - 'videodb://tvshows/titles/%s/' % show_id) - else: - js.activate_window('videos', - 'videodb://tvshows/titles/%s' % show_id) - else: - LOG.error('Could not find tv show id for %s', item) - if resolve: - pickler.pickle_me(pickler.Playback_Successful()) elif mode == 'context_menu': context_entry.ContextMenu(kodi_id=params.get('kodi_id'), kodi_type=params.get('kodi_type')) diff --git a/resources/lib/service_entry.py b/resources/lib/service_entry.py index fa7932b0..56fe0fc5 100644 --- a/resources/lib/service_entry.py +++ b/resources/lib/service_entry.py @@ -403,9 +403,6 @@ class Service(): # Add-on path playback! task = playback_starter.PlaybackTask( plex_command.replace('PLAY-', '')) - elif plex_command.startswith('NAVIGATE-'): - task = playback_starter.PlaybackTask( - plex_command.replace('NAVIGATE-', '')) elif plex_command.startswith('CONTEXT_menu?'): task = playback_starter.PlaybackTask( 'dummy?mode=context_menu&%s'