diff --git a/core/autoplay.py b/core/autoplay.py index 327c74b6..c0f7e383 100644 --- a/core/autoplay.py +++ b/core/autoplay.py @@ -103,7 +103,7 @@ def start(itemlist, item): pass # sleep(3) try: - if platformtools.is_playing() or autoplay_elem.server == 'torrent': + if platformtools.is_playing(): PLAYED = True break except: @@ -119,7 +119,7 @@ def start(itemlist, item): max_intents_servers[videoitem.server.lower()] = max_intents # If there are no items in the list, it is reported - if autoplay_elem == autoplay_list[-1]: + if autoplay_elem == autoplay_list[-1] and autoplay_elem.server != 'torrent': platformtools.dialog_notification('AutoPlay', config.get_localized_string(60072) % name) else: diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 7f66991a..59d288ff 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -1478,7 +1478,6 @@ def play_torrent(item, xlistitem, mediaurl): from servers import torrent torrent_options = torrent_client_installed(show_tuple=True) - # from core.support import dbg;dbg() if len(torrent_options) == 0: from platformcode import elementum_download install = elementum_download.download() @@ -1492,9 +1491,11 @@ def play_torrent(item, xlistitem, mediaurl): selection = 0 if selection >= 0: - xbmc.Player().play(os.path.join(config.get_runtime_path(), "resources", "kod.mp4")) + 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] @@ -1509,7 +1510,6 @@ def play_torrent(item, xlistitem, mediaurl): torrent.elementum_download(item) else: time.sleep(3) - # xbmc.Player().play(torrent_options[selection][1] % mediaurl) xbmc.executebuiltin("PlayMedia(" + torrent_options[selection][1] % mediaurl + ")") # torrent.mark_auto_as_watched(item) @@ -1826,4 +1826,8 @@ def prevent_busy(item): 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() \ No newline at end of file + xbmc.Player().stop() + # xbmc.executebuiltin('Action(Stop)') + # xbmc.sleep(500) + # xbmc.Player().stop() + # xbmc.sleep(500) \ No newline at end of file