Fix riproduzione torrent senza autoplay e riproduzione dopo installazione automatica di Elementum

This commit is contained in:
Alhaziel01
2021-11-05 09:48:12 +01:00
parent 158372ed1b
commit f24e8c8da6
4 changed files with 12 additions and 6 deletions

View File

@@ -52,6 +52,7 @@ def download(item=None):
ret = False
else:
ret = False
return ret
def extract():

View File

@@ -179,7 +179,7 @@ class Main(xbmcgui.WindowXMLDialog):
def submenu(self):
itmlist = []
itemlist = []
channel_name = self.MENU.getSelectedItem().getProperty('channel')
focus = int(self.MENU.getSelectedItem().getProperty('focus'))
if channel_name == 'channelselector':

View File

@@ -471,10 +471,7 @@ 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:
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4")))
while not platformtools.is_playing():
xbmc.sleep(10)
xbmc.Player().stop()
platformtools.fakeVideo()
platformtools.prevent_busy()

View File

@@ -1482,7 +1482,7 @@ def play_torrent(item, xlistitem, mediaurl):
install = elementum_download.download()
if install:
return play_torrent(item, xlistitem, mediaurl)
else:
else:
selection = -1
elif len(torrent_options) > 1:
selection = dialog_select(config.get_localized_string(70193), [opcion[0] for opcion in torrent_options])
@@ -1511,6 +1511,7 @@ def play_torrent(item, xlistitem, mediaurl):
playlist.add(torrent_options[selection][1] % mediaurl, xlistitem)
xbmc_player.play(playlist, xlistitem)
else:
if not item.autoplay: fakeVideo()
xbmc.executebuiltin("PlayMedia(" + torrent_options[selection][1] % mediaurl + ")")
# torrent.mark_auto_as_watched(item)
@@ -1822,3 +1823,10 @@ def set_played_time(item):
def prevent_busy():
xbmc.executebuiltin('Dialog.Close(all,true)')
def fakeVideo():
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4")))
while not is_playing():
xbmc.sleep(10)
xbmc.Player().stop()