From 0c76096a223d7189687f2a849f63b4cdfb26159a Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Wed, 1 Dec 2021 11:31:48 +0100 Subject: [PATCH] Test Fix pop-up server 2 --- platformcode/launcher.py | 2 +- platformcode/platformtools.py | 18 +++++++----------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/platformcode/launcher.py b/platformcode/launcher.py index 238da5a0..b0ce58a9 100644 --- a/platformcode/launcher.py +++ b/platformcode/launcher.py @@ -170,8 +170,8 @@ def run(item=None): xbmc.executebuiltin("Container.Update(%s?%s)" % (sys.argv[0], item.tourl())) elif reload and item.channel == 'filmontv' and item.action == 'new_search': - platformtools.fakeVideo() import xbmc + platformtools.fakeVideo() return xbmc.executebuiltin("Container.Update(" + sys.argv[0] + "?" + item.tourl() + ")") else: # Checks if channel exists diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 270a77b4..5dc4081c 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -1677,20 +1677,16 @@ def set_played_time(item): del db['viewed'][ID] -def prevent_busy(item=None): - if item and (not item.autoplay and item.channel != 'videolibrary' and not item.window): - fakeVideo() - else: - xbmc.executebuiltin('Dialog.Close(all,true)') +def prevent_busy(): + xbmc.executebuiltin('Dialog.Close(all,true)') def fakeVideo(sleep = False): mediaurl = os.path.join(config.get_runtime_path(), "resources", "kod.mp4") - xbmc.executebuiltin("PlayMedia(" + mediaurl + ")") - if sleep: - while is_playing(): - xbmc.sleep(sleep) - xbmc.Player().stop() + xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=mediaurl)) + while not is_playing(): + xbmc.sleep(200) + xbmc.Player().stop() def channelImport(channelId): @@ -1716,7 +1712,7 @@ def serverWindow(item, itemlist): ENTER = 7 EXIT = 10 BACKSPACE = 92 - xbmc.executebuiltin('Dialog.Close(all,true)') + prevent_busy() class ServerWindow(xbmcgui.WindowXMLDialog): def start(self, item, itemlist):