diff --git a/platformcode/elementum_download.py b/platformcode/elementum_download.py index b74a7f20..3c83443b 100644 --- a/platformcode/elementum_download.py +++ b/platformcode/elementum_download.py @@ -52,6 +52,7 @@ def download(item=None): ret = False else: ret = False + return ret def extract(): diff --git a/platformcode/keymaptools.py b/platformcode/keymaptools.py index ac98cfac..57f911c4 100644 --- a/platformcode/keymaptools.py +++ b/platformcode/keymaptools.py @@ -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': diff --git a/platformcode/launcher.py b/platformcode/launcher.py index 1307c672..f6ff55cf 100644 --- a/platformcode/launcher.py +++ b/platformcode/launcher.py @@ -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() diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 5fdb150e..ac569d59 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -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() \ No newline at end of file