diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 59d288ff..b654d307 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -1491,11 +1491,11 @@ def play_torrent(item, xlistitem, mediaurl): selection = 0 if selection >= 0: - if item.autoplay: xbmc.Player().play(os.path.join(config.get_runtime_path(), "resources", "kod.mp4")) - else: xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4"))) - xbmc.sleep(200) - xbmc.Player().stop() - # prevent_busy(item) + # if item.autoplay: xbmc.Player().play(os.path.join(config.get_runtime_path(), "resources", "kod.mp4")) + # else: xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4"))) + # xbmc.sleep(200) + # xbmc.Player().stop() + prevent_busy(item) mediaurl = urllib.quote_plus(item.url) torr_client = torrent_options[selection][0] @@ -1821,13 +1821,4 @@ def set_played_time(item): def prevent_busy(item): - logger.debug() - if item.action == 'play_from_library' or (not item.autoplay and not item.window): - if item.globalsearch: xbmc.Player().play(os.path.join(config.get_runtime_path(), "resources", "kod.mp4")) - else: xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4"))) - xbmc.sleep(200) - xbmc.Player().stop() - # xbmc.executebuiltin('Action(Stop)') - # xbmc.sleep(500) - # xbmc.Player().stop() - # xbmc.sleep(500) \ No newline at end of file + xbmc.executebuiltin('Dialog.Close(all,true)') diff --git a/service.py b/service.py index cbd27993..2da0d84b 100644 --- a/service.py +++ b/service.py @@ -6,7 +6,6 @@ import sys import threading import traceback import xbmc -from platformcode import config try: from urllib.parse import urlsplit @@ -18,6 +17,7 @@ try: xbmc.translatePath = xbmcvfs.translatePath except: pass +from platformcode import config librerias = xbmc.translatePath(os.path.join(config.get_runtime_path(), 'lib')) sys.path.insert(0, librerias)