Test Fix pop-up server
This commit is contained in:
@@ -441,24 +441,24 @@ def findvideos(item):
|
||||
p_dialog = platformtools.dialog_progress_bg(config.get_localized_string(20000), config.get_localized_string(60683))
|
||||
p_dialog.update(0)
|
||||
|
||||
# First checks if channel has a "findvideos" function
|
||||
if hasattr(channel, 'findvideos'):
|
||||
itemlist = getattr(channel, item.action)(item)
|
||||
try:
|
||||
# First checks if channel has a "findvideos" function
|
||||
if hasattr(channel, 'findvideos'):
|
||||
itemlist = getattr(channel, item.action)(item)
|
||||
|
||||
# If not, uses the generic findvideos function
|
||||
else:
|
||||
logger.debug('No channel "findvideos" method, executing core method')
|
||||
itemlist = servertools.find_video_items(item)
|
||||
# If not, uses the generic findvideos function
|
||||
else:
|
||||
logger.debug('No channel "findvideos" method, executing core method')
|
||||
itemlist = servertools.find_video_items(item)
|
||||
|
||||
itemlist = limit_itemlist(itemlist)
|
||||
itemlist = limit_itemlist(itemlist)
|
||||
except:
|
||||
itemlist = []
|
||||
platformtools.dialog_notification(config.get_localized_string(20000), config.get_localized_string(60347))
|
||||
|
||||
p_dialog.update(100)
|
||||
p_dialog.close()
|
||||
|
||||
# If there is only one server play it immediately
|
||||
# if len(itemlist) == 1 or len(itemlist) > 1 and not itemlist[1].server:
|
||||
# play(itemlist[0].clone(no_return=True))
|
||||
# else:
|
||||
platformtools.serverWindow(item, itemlist)
|
||||
|
||||
def play_from_library(item):
|
||||
|
||||
@@ -336,7 +336,7 @@ def render_items(itemlist, parent_item):
|
||||
if not item.title:
|
||||
item.title = ''
|
||||
# If there is no action or it is findvideos / play, folder = False because no listing will be returned
|
||||
if item.action in ['play', '']:
|
||||
if item.action in ['play', 'findvideos', '']:
|
||||
item.folder = False
|
||||
if item.fanart == "":
|
||||
item.fanart = parent_item.fanart
|
||||
@@ -1716,6 +1716,7 @@ def serverWindow(item, itemlist):
|
||||
ENTER = 7
|
||||
EXIT = 10
|
||||
BACKSPACE = 92
|
||||
xbmc.executebuiltin('Dialog.Close(all,true)')
|
||||
|
||||
class ServerWindow(xbmcgui.WindowXMLDialog):
|
||||
def start(self, item, itemlist):
|
||||
@@ -1795,6 +1796,7 @@ def serverWindow(item, itemlist):
|
||||
|
||||
if itemlist:
|
||||
reopen = False
|
||||
from core import db
|
||||
while not xbmc.Monitor().abortRequested():
|
||||
played = True
|
||||
if not is_playing():
|
||||
@@ -1803,8 +1805,8 @@ def serverWindow(item, itemlist):
|
||||
if is_playing():
|
||||
return
|
||||
if config.get_setting('autoplay') or reopen:
|
||||
played_time = get_played_time(item)
|
||||
if not played_time and played:
|
||||
xbmc.sleep(200)
|
||||
if not db['controls'].get('reopen', False):
|
||||
return
|
||||
|
||||
selection = ServerWindow('Servers.xml', config.get_runtime_path()).start(item, itemlist)
|
||||
@@ -1818,3 +1820,4 @@ def serverWindow(item, itemlist):
|
||||
from platformcode.launcher import run
|
||||
run(selection)
|
||||
reopen = True
|
||||
db.close()
|
||||
|
||||
@@ -86,9 +86,13 @@ def mark_auto_as_watched(item):
|
||||
break
|
||||
|
||||
# if item.options['continue']:
|
||||
from core import db
|
||||
if actual_time < mark_time and mark_time:
|
||||
item.played_time = actual_time
|
||||
else: item.played_time = 0
|
||||
db['controls']['reopen'] = True
|
||||
else:
|
||||
item.played_time = 0
|
||||
db['controls']['reopen'] = False
|
||||
platformtools.set_played_time(item)
|
||||
|
||||
# Silent sync with Trakt
|
||||
@@ -107,14 +111,13 @@ def mark_auto_as_watched(item):
|
||||
run(next_episode)
|
||||
|
||||
# db need to be closed when not used, it will cause freezes
|
||||
from core import db
|
||||
db.close()
|
||||
# from core.support import dbg;dbg()
|
||||
|
||||
# If it is configured to mark as seen
|
||||
if config.get_setting("mark_as_watched", "videolibrary"):
|
||||
threading.Thread(target=mark_as_watched_subThread, args=[item]).start()
|
||||
|
||||
logger.debug('EXIT MONITOR')
|
||||
|
||||
def sync_trakt_addon(path_folder):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user