Fix per dispositivi lenti
This commit is contained in:
@@ -1012,12 +1012,6 @@ def set_player(item, xlistitem, mediaurl, view, strm):
|
||||
item.options = {'strm':False, 'continue':False}
|
||||
# logger.debug("item:\n" + item.tostring('\n'))
|
||||
|
||||
# Prevent Busy
|
||||
if not item.autoplay:
|
||||
if item.globalsearch: xbmc.executebuiltin("PlayMedia(" + 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.Player().stop()
|
||||
|
||||
# Moved del conector "torrent" here
|
||||
if item.server == "torrent":
|
||||
play_torrent(item, xlistitem, mediaurl)
|
||||
@@ -1039,14 +1033,12 @@ def set_player(item, xlistitem, mediaurl, view, strm):
|
||||
logger.info("mediaurl=" + mediaurl)
|
||||
|
||||
if player_mode in [0,1]:
|
||||
prevent_busy(item)
|
||||
logger.info('Player Mode:' + ['Direct', 'Bookmark'][player_mode])
|
||||
# Add the listitem to a playlist
|
||||
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
|
||||
playlist.clear()
|
||||
playlist.add(mediaurl, xlistitem)
|
||||
|
||||
# played_time = resume_playback(get_played_time(item))
|
||||
|
||||
# Reproduce
|
||||
xbmc_player.play(playlist, xlistitem)
|
||||
# viewed(item, played_time)
|
||||
@@ -1441,3 +1433,11 @@ def set_played_time(item):
|
||||
else: c.execute("INSERT INTO viewed (tmdb_id, episode, played_time) VALUES (?, ?, ?)", (ID, E, item.played_time))
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
||||
def prevent_busy(item):
|
||||
logger.debug()
|
||||
if 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(500)
|
||||
xbmc.Player().stop()
|
||||
Reference in New Issue
Block a user