Miglioria del precedente commit
This commit is contained in:
@@ -459,7 +459,7 @@ def play_from_library(item):
|
||||
from time import sleep
|
||||
|
||||
# logger.debug("item: \n" + item.tostring('\n'))
|
||||
platformtools.prevent_busy(item)
|
||||
platformtools.prevent_busy()
|
||||
|
||||
itemlist=[]
|
||||
item.fromLibrary = True
|
||||
|
||||
@@ -1387,7 +1387,7 @@ def set_player(item, xlistitem, mediaurl, view, strm):
|
||||
logger.info("mediaurl=" + mediaurl)
|
||||
|
||||
if player_mode in [0,1]:
|
||||
prevent_busy(item)
|
||||
prevent_busy()
|
||||
if player_mode in [1]:
|
||||
item.played_time = resume_playback(get_played_time(item))
|
||||
|
||||
@@ -1491,11 +1491,7 @@ def play_torrent(item, xlistitem, mediaurl):
|
||||
selection = 0
|
||||
|
||||
if selection >= 0:
|
||||
# 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)
|
||||
prevent_busy()
|
||||
|
||||
mediaurl = urllib.quote_plus(item.url)
|
||||
torr_client = torrent_options[selection][0]
|
||||
@@ -1509,8 +1505,12 @@ def play_torrent(item, xlistitem, mediaurl):
|
||||
if torr_client in ['elementum'] and item.downloadFilename:
|
||||
torrent.elementum_download(item)
|
||||
else:
|
||||
time.sleep(3)
|
||||
xbmc.executebuiltin("PlayMedia(" + torrent_options[selection][1] % mediaurl + ")")
|
||||
# time.sleep(3)
|
||||
if item.fromLibrary:
|
||||
xlistitem.setPath(torrent_options[selection][1] % mediaurl)
|
||||
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xlistitem)
|
||||
else:
|
||||
xbmc.executebuiltin("PlayMedia(" + torrent_options[selection][1] % mediaurl + ")")
|
||||
|
||||
# torrent.mark_auto_as_watched(item)
|
||||
|
||||
@@ -1819,6 +1819,5 @@ def set_played_time(item):
|
||||
del db['viewed'][ID]
|
||||
|
||||
|
||||
|
||||
def prevent_busy(item):
|
||||
def prevent_busy():
|
||||
xbmc.executebuiltin('Dialog.Close(all,true)')
|
||||
|
||||
@@ -377,7 +377,12 @@ def set_watched_on_kod(data):
|
||||
|
||||
path = filetools.join(path, filename)
|
||||
head_nfo, item = videolibrarytools.read_nfo(path)
|
||||
item.library_playcounts.update({title: playcount})
|
||||
from core.support import dbg
|
||||
dbg()
|
||||
if item.library_playcounts:
|
||||
item.library_playcounts.update({title: playcount})
|
||||
else:
|
||||
item.library_playcounts = {title: playcount}
|
||||
filetools.write(path, head_nfo + item.tojson())
|
||||
|
||||
if item.infoLabels['mediatype'] == "tvshow":
|
||||
|
||||
Reference in New Issue
Block a user