Skip to content

Commit

Permalink
Further updates for multiple busy dialog crash workaround anxdpanic#891
Browse files Browse the repository at this point in the history
  • Loading branch information
MoojMidge committed Sep 3, 2024
1 parent 75f1f92 commit ae97f89
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ def stop(self):
def pause(self):
return self._player.pause()

def play_item(self, *args, **kwargs):
return self._player.play(*args, **kwargs)

def is_playing(self):
return self._player.isPlaying()

Expand Down
18 changes: 13 additions & 5 deletions resources/lib/youtube_plugin/kodion/plugin/xbmc/xbmc_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,13 @@ def run(self, provider, context, focused=None):
self.handle = context.get_handle()
ui = context.get_ui()

route = ui.pop_property(REROUTE_PATH)
for was_busy in (ui.pop_property(BUSY_FLAG),):
if was_busy:
if ui.busy_dialog_active():
ui.set_property(BUSY_FLAG)
if route:
break
else:
break

Expand Down Expand Up @@ -158,7 +161,6 @@ def run(self, provider, context, focused=None):
provider.run_wizard(context)

try:
route = ui.pop_property(REROUTE_PATH)
if route:
function_cache = context.get_function_cache()
result, options = function_cache.run(
Expand Down Expand Up @@ -206,10 +208,16 @@ def run(self, provider, context, focused=None):
result,
show_fanart=context.get_settings().fanart_selection(),
)
result = True
xbmcplugin.setResolvedUrl(self.handle,
succeeded=result,
listitem=item)
result = xbmcplugin.addDirectoryItem(self.handle,
url=uri,
listitem=item)
if route:
playlist_player = context.get_playlist_player()
playlist_player.play_item(item=uri, listitem=item)
else:
xbmcplugin.setResolvedUrl(self.handle,
succeeded=result,
listitem=item)

elif uri.startswith('script://'):
uri = uri[len('script://'):]
Expand Down

0 comments on commit ae97f89

Please sign in to comment.