Fix parziale autoplay con Torrent

This commit is contained in:
Alhaziel01
2021-10-30 11:22:15 +02:00
parent cce2e330ba
commit 0aebc644fa
2 changed files with 10 additions and 6 deletions

View File

@@ -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:

View File

@@ -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()
xbmc.Player().stop()
# xbmc.executebuiltin('Action(Stop)')
# xbmc.sleep(500)
# xbmc.Player().stop()
# xbmc.sleep(500)