diff --git a/platformcode/launcher.py b/platformcode/launcher.py index f6ff55cf..ce05b5bb 100644 --- a/platformcode/launcher.py +++ b/platformcode/launcher.py @@ -470,9 +470,10 @@ def play_from_library(item): # logger.debug("item: \n" + item.tostring('\n')) # xbmc.Player().play(os.path.join(config.get_runtime_path(), "resources", "kod.mp4")) - if not item.autoplay: - platformtools.fakeVideo() - platformtools.prevent_busy() + # if not item.autoplay: + # platformtools.fakeVideo() + + platformtools.prevent_busy(item) itemlist=[] diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 873c1b6d..2a406fc0 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -1386,7 +1386,7 @@ def set_player(item, xlistitem, mediaurl, view, strm): logger.info("mediaurl=" + mediaurl) if player_mode in [0,1]: - prevent_busy() + prevent_busy(item) if player_mode in [1]: item.played_time = resume_playback(get_played_time(item)) @@ -1473,7 +1473,6 @@ def torrent_client_installed(show_tuple=False): def play_torrent(item, xlistitem, mediaurl): logger.debug() - import time from servers import torrent torrent_options = torrent_client_installed(show_tuple=True) @@ -1505,6 +1504,7 @@ def play_torrent(item, xlistitem, mediaurl): torrent.elementum_download(item) else: + # xbmc.executebuiltin("PlayMedia(" + torrent_options[selection][1] % mediaurl + ")") if (item.fromLibrary and item.play_from == 'window') or item.window: xlistitem.setPath(torrent_options[selection][1] % mediaurl) playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO) @@ -1822,8 +1822,11 @@ def set_played_time(item): del db['viewed'][ID] -def prevent_busy(): - xbmc.executebuiltin('Dialog.Close(all,true)') +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 fakeVideo(): diff --git a/platformcode/xbmc_videolibrary.py b/platformcode/xbmc_videolibrary.py index c8cc3b49..23345dbc 100644 --- a/platformcode/xbmc_videolibrary.py +++ b/platformcode/xbmc_videolibrary.py @@ -100,7 +100,7 @@ def mark_auto_as_watched(item): xbmc.sleep(700) xbmc.executebuiltin('Action(ParentDir)') xbmc.sleep(500) - # from core.support import dbg;dbg() + if next_episode and next_episode.next_ep and config.get_setting('next_ep') < 3: from platformcode.launcher import run run(next_episode) diff --git a/specials/globalsearch.py b/specials/globalsearch.py index d5eb8e97..35b1c9d4 100644 --- a/specials/globalsearch.py +++ b/specials/globalsearch.py @@ -812,7 +812,7 @@ class SearchWindow(xbmcgui.WindowXML): def play(self, server=None): - platformtools.prevent_busy() + platformtools.prevent_busy(server) server.window = True server.globalsearch = True return run(server)