mirror of
https://github.com/anxdpanic/plugin.video.youtube.git
synced 2025-12-15 15:10:34 -08:00
Fix regression preventing video playback from Kodi Info dialog #1184
This commit is contained in:
parent
5de15aeb12
commit
a0eb84c1ea
6 changed files with 17 additions and 17 deletions
|
|
@ -246,7 +246,7 @@ class AbstractProvider(object):
|
|||
del params['exclude']
|
||||
params = dict(params, page=page, page_token=page_token)
|
||||
|
||||
if (not ui.busy_dialog_visible()
|
||||
if (not ui.busy_dialog_active()
|
||||
and context.is_plugin_path(
|
||||
context.get_infolabel('Container.FolderPath'),
|
||||
partial=True,
|
||||
|
|
@ -368,7 +368,7 @@ class AbstractProvider(object):
|
|||
))
|
||||
|
||||
timeout = 30
|
||||
while ui.busy_dialog_visible():
|
||||
while ui.busy_dialog_active():
|
||||
timeout -= 1
|
||||
if timeout < 0:
|
||||
context.log_warning('Multiple busy dialogs active'
|
||||
|
|
|
|||
|
|
@ -355,7 +355,7 @@ class PlayerMonitor(xbmc.Player):
|
|||
self.threads = active_threads
|
||||
|
||||
def onPlayBackStarted(self):
|
||||
if not self._ui.busy_dialog_visible():
|
||||
if not self._ui.busy_dialog_active():
|
||||
self._ui.clear_property(BUSY_FLAG)
|
||||
|
||||
if self._ui.get_property(PLAY_WITH):
|
||||
|
|
@ -367,7 +367,7 @@ class PlayerMonitor(xbmc.Player):
|
|||
if self._ui.get_property(PLAY_WITH):
|
||||
return
|
||||
|
||||
if not self._ui.busy_dialog_visible():
|
||||
if not self._ui.busy_dialog_active():
|
||||
self._ui.clear_property(BUSY_FLAG)
|
||||
|
||||
player_data = self._ui.pop_property(PLAYER_DATA)
|
||||
|
|
@ -396,7 +396,7 @@ class PlayerMonitor(xbmc.Player):
|
|||
player_data))
|
||||
|
||||
def onPlayBackEnded(self):
|
||||
if not self._ui.busy_dialog_visible():
|
||||
if not self._ui.busy_dialog_active():
|
||||
self._ui.clear_property(BUSY_FLAG)
|
||||
|
||||
self._ui.pop_property(PLAY_WITH)
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class ServiceMonitor(xbmc.Monitor):
|
|||
super(ServiceMonitor, self).__init__()
|
||||
|
||||
@staticmethod
|
||||
def busy_dialog_visible(dialog_ids=frozenset((
|
||||
def busy_dialog_active(all_modals=False, dialog_ids=frozenset((
|
||||
10100, # WINDOW_DIALOG_YES_NO
|
||||
10101, # WINDOW_DIALOG_PROGRESS
|
||||
10103, # WINDOW_DIALOG_KEYBOARD
|
||||
|
|
@ -71,7 +71,7 @@ class ServiceMonitor(xbmc.Monitor):
|
|||
12000, # WINDOW_DIALOG_SELECT
|
||||
12002, # WINDOW_DIALOG_OK
|
||||
))):
|
||||
if xbmc.getCondVisibility('System.HasVisibleModalDialog'):
|
||||
if all_modals and xbmc.getCondVisibility('System.HasActiveModalDialog'):
|
||||
return True
|
||||
dialog_id = xbmcgui.getCurrentWindowDialogId()
|
||||
if dialog_id in dialog_ids:
|
||||
|
|
@ -82,7 +82,7 @@ class ServiceMonitor(xbmc.Monitor):
|
|||
def is_plugin_container(url='plugin://{0}/'.format(ADDON_ID),
|
||||
check_all=False,
|
||||
_bool=xbmc.getCondVisibility,
|
||||
_busy=busy_dialog_visible.__func__,
|
||||
_busy=busy_dialog_active.__func__,
|
||||
_label=xbmc.getInfoLabel):
|
||||
if check_all:
|
||||
return (not _bool('Container.IsUpdating')
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class XbmcPlugin(AbstractPlugin):
|
|||
succeeded = False
|
||||
for was_busy in (ui.pop_property(BUSY_FLAG),):
|
||||
if was_busy:
|
||||
if ui.busy_dialog_visible():
|
||||
if ui.busy_dialog_active():
|
||||
ui.set_property(BUSY_FLAG)
|
||||
if route:
|
||||
break
|
||||
|
|
@ -124,7 +124,7 @@ class XbmcPlugin(AbstractPlugin):
|
|||
continue
|
||||
|
||||
timeout = 30
|
||||
while ui.busy_dialog_visible():
|
||||
while ui.busy_dialog_active():
|
||||
timeout -= 1
|
||||
if timeout < 0:
|
||||
context.log_error('Multiple busy dialogs active'
|
||||
|
|
@ -142,7 +142,7 @@ class XbmcPlugin(AbstractPlugin):
|
|||
position = 1
|
||||
timeout = num_items
|
||||
|
||||
while ui.busy_dialog_visible() or playlist_player.size() < position:
|
||||
while ui.busy_dialog_active() or playlist_player.size() < position:
|
||||
timeout -= 1
|
||||
if timeout < 0:
|
||||
context.log_error('Multiple busy dialogs active'
|
||||
|
|
@ -364,7 +364,7 @@ class XbmcPlugin(AbstractPlugin):
|
|||
def post_run(context, ui, *actions, **kwargs):
|
||||
timeout = kwargs.get('timeout', 30)
|
||||
for action in actions:
|
||||
while ui.busy_dialog_visible():
|
||||
while ui.busy_dialog_active():
|
||||
timeout -= 1
|
||||
if timeout < 0:
|
||||
context.log_error('Multiple busy dialogs active'
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ class XbmcContextUI(AbstractContextUI):
|
|||
)
|
||||
|
||||
@staticmethod
|
||||
def busy_dialog_visible(dialog_ids=frozenset((
|
||||
def busy_dialog_active(all_modals=False, dialog_ids=frozenset((
|
||||
10100, # WINDOW_DIALOG_YES_NO
|
||||
10101, # WINDOW_DIALOG_PROGRESS
|
||||
10103, # WINDOW_DIALOG_KEYBOARD
|
||||
|
|
@ -276,7 +276,7 @@ class XbmcContextUI(AbstractContextUI):
|
|||
12000, # WINDOW_DIALOG_SELECT
|
||||
12002, # WINDOW_DIALOG_OK
|
||||
))):
|
||||
if xbmc.getCondVisibility('System.HasVisibleModalDialog'):
|
||||
if all_modals and xbmc.getCondVisibility('System.HasActiveModalDialog'):
|
||||
return True
|
||||
dialog_id = xbmcgui.getCurrentWindowDialogId()
|
||||
if dialog_id in dialog_ids:
|
||||
|
|
@ -301,7 +301,7 @@ class XbmcProgressDialog(object):
|
|||
return
|
||||
|
||||
self._ui = ui
|
||||
if ui.busy_dialog_visible():
|
||||
if ui.busy_dialog_active(all_modals=True):
|
||||
self._dialog = dialog()
|
||||
self._dialog.create(heading, message)
|
||||
self._created = True
|
||||
|
|
@ -422,7 +422,7 @@ class XbmcProgressDialog(object):
|
|||
self._message = message
|
||||
|
||||
if not self._created:
|
||||
if self._ui.busy_dialog_visible():
|
||||
if self._ui.busy_dialog_active(all_modals=True):
|
||||
return
|
||||
self._dialog.create(self._heading, self._message)
|
||||
self._created = True
|
||||
|
|
|
|||
|
|
@ -486,7 +486,7 @@ def process_items_for_playlist(context,
|
|||
if action == 'play':
|
||||
ui = context.get_ui()
|
||||
timeout = position
|
||||
while ui.busy_dialog_visible() or playlist_player.size() < position:
|
||||
while ui.busy_dialog_active() or playlist_player.size() < position:
|
||||
timeout -= 1
|
||||
if timeout < 0:
|
||||
command = playlist_player.play_playlist_item(position,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue