Fix gestione finestra server
This commit is contained in:
@@ -313,12 +313,16 @@ def findvideos(item, itemlist=[]):
|
||||
p_dialog.close()
|
||||
|
||||
serverlist = [s for s in itemlist if s.server]
|
||||
|
||||
if itemlist and not serverlist:
|
||||
platformtools.render_items(itemlist, item)
|
||||
if not serverlist:
|
||||
platformtools.dialog_notification(config.get_localized_string(20000), config.get_localized_string(60347))
|
||||
elif len(serverlist) == 1:
|
||||
# If there is only one server play it immediately
|
||||
from core import db
|
||||
db['player']['itemlist'] = []
|
||||
db.close()
|
||||
play(itemlist[0].clone(no_return=True))
|
||||
else:
|
||||
platformtools.serverWindow(item, itemlist)
|
||||
|
||||
@@ -2013,37 +2013,18 @@ def serverWindow(item, itemlist):
|
||||
|
||||
|
||||
if itemlist:
|
||||
reopen = False
|
||||
|
||||
if config.get_setting('autoplay') and not item.disableAutoplay:
|
||||
reopen = True
|
||||
from core import autoplay
|
||||
autoplay.start(itemlist, item)
|
||||
|
||||
def monitor(itemlist, reopen):
|
||||
while not xbmc.Monitor().abortRequested():
|
||||
if not is_playing():
|
||||
if reopen:
|
||||
xbmc.sleep(200)
|
||||
if not db['controls'].get('reopen', False):
|
||||
break
|
||||
if config.get_setting('window_type') == 0:
|
||||
selection = ServerSkinWindow("DialogSelect.xml", config.get_runtime_path()).start(item, itemlist)
|
||||
reopen = True
|
||||
else:
|
||||
selection = ServerWindow('Servers.xml', config.get_runtime_path()).start(item, itemlist)
|
||||
reopen = True
|
||||
|
||||
if selection == -1:
|
||||
break
|
||||
|
||||
else:
|
||||
from platformcode.launcher import run
|
||||
try:
|
||||
run(selection)
|
||||
except:
|
||||
reopen = False
|
||||
if not selection.server or selection.server == 'torrent': break
|
||||
|
||||
import threading
|
||||
# monitor(itemlist, reopen)
|
||||
threading.Thread(target=monitor, args=[itemlist, reopen]).start()
|
||||
if config.get_setting('window_type') == 0:
|
||||
selection = ServerSkinWindow("DialogSelect.xml", config.get_runtime_path()).start(item, itemlist)
|
||||
else:
|
||||
selection = ServerWindow('Servers.xml', config.get_runtime_path()).start(item, itemlist)
|
||||
if selection != -1:
|
||||
from core import db
|
||||
from platformcode.launcher import run
|
||||
db['player']['itemlist'] = itemlist
|
||||
db.close()
|
||||
run(selection)
|
||||
|
||||
@@ -83,18 +83,8 @@ def mark_auto_as_watched(item):
|
||||
break
|
||||
|
||||
# if item.options['continue']:
|
||||
from core import db
|
||||
if marked:
|
||||
logger.debug('CLOSE')
|
||||
item.played_time = 0
|
||||
if total_time > 20:
|
||||
db['controls']['reopen'] = False
|
||||
else:
|
||||
db['controls']['reopen'] = True
|
||||
else:
|
||||
logger.debug('REOPEN')
|
||||
item.played_time = actual_time
|
||||
db['controls']['reopen'] = True
|
||||
if (marked and total_time < 20) or not marked:
|
||||
platformtools.serverWindow(item, itemlist)
|
||||
|
||||
platformtools.set_played_time(item)
|
||||
|
||||
@@ -112,7 +102,10 @@ def mark_auto_as_watched(item):
|
||||
db.close()
|
||||
|
||||
# If it is configured to mark as seen
|
||||
from core import db
|
||||
if config.get_setting("mark_as_watched", "videolibrary"):
|
||||
itemlist = db['player'].get('itemlist', [])
|
||||
db.close()
|
||||
threading.Thread(target=mark_as_watched_subThread, args=[item]).start()
|
||||
logger.debug('EXIT MONITOR')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user