Modifiche e Fix a segna come già visto
This commit is contained in:
+2
-13
@@ -683,17 +683,7 @@ def sort_servers(servers_list):
|
||||
return []
|
||||
|
||||
blacklisted_servers = config.get_setting("black_list", server='servers', default=[])
|
||||
favorite_servers = config.get_setting('favorites_servers_list', server='servers', default=[])
|
||||
favorite_servers = [s for s in favorite_servers if s not in blacklisted_servers]
|
||||
|
||||
if isinstance(servers_list[0], str):
|
||||
servers_list = sorted(servers_list, key=lambda x: favorite_servers.index(x) if x in favorite_servers else 999)
|
||||
return servers_list
|
||||
|
||||
favorite_quality = ['4k', '2160p', '2160', '4k2160p', '4k2160', '4k 2160p', '4k 2160', '2k',
|
||||
'fullhd', 'fullhd 1080', 'fullhd 1080p', 'full hd', 'full hd 1080', 'full hd 1080p', 'hd1080', 'hd1080p', 'hd 1080', 'hd 1080p', '1080', '1080p',
|
||||
'hd', 'hd720', 'hd720p', 'hd 720', 'hd 720p', '720', '720p', 'hdtv',
|
||||
'sd', '480p', '480', '360p', '360', '240p', '240']
|
||||
favorite_servers = [s for s in config.get_setting('favorites_servers_list', server='servers', default=[]) if s not in blacklisted_servers]
|
||||
|
||||
sorted_list = []
|
||||
inverted = False
|
||||
@@ -721,9 +711,8 @@ def sort_servers(servers_list):
|
||||
continue
|
||||
|
||||
element["index_server"] = index(favorite_servers, item.server.lower())
|
||||
element["index_quality"] = index(favorite_quality, item.quality.lower())
|
||||
element["index_quality"] = platformtools.calcResolution(item.quality)
|
||||
element['index_language'] = 0 if item.contentLanguage == 'ITA' else 1
|
||||
|
||||
element['videoitem'] = item
|
||||
sorted_list.append(element)
|
||||
|
||||
|
||||
+3
-6
@@ -597,7 +597,7 @@ def scrape(func):
|
||||
if anime and inspect.stack()[1][3] not in ['find_episodes']:
|
||||
from platformcode import autorenumber
|
||||
if function == 'episodios': autorenumber.start(itemlist, item)
|
||||
else: autorenumber.start(itemlist)
|
||||
else: autorenumber.start(itemlist, item)
|
||||
|
||||
if action != 'play' and 'patronMenu' not in args and 'patronGenreMenu' not in args and not disabletmdb and inspect.stack()[1][3] not in ['add_tvshow'] and function not in ['episodios', 'mainlist'] or (function in ['episodios'] and config.get_setting('episode_info')): # and function != 'episodios' and item.contentType in ['movie', 'tvshow', 'episode', 'undefined']
|
||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
@@ -1139,12 +1139,10 @@ def videolibrary(itemlist, item, typography='', function_level=1, function=''):
|
||||
logger.debug()
|
||||
|
||||
if item.contentType == 'movie':
|
||||
action = 'add_movie_to_library'
|
||||
extra = 'findvideos'
|
||||
action = 'add_to_library'
|
||||
contentType = 'movie'
|
||||
else:
|
||||
action = 'add_serie_to_library'
|
||||
extra = 'episodios'
|
||||
action = 'add_to_library'
|
||||
contentType = 'tvshow'
|
||||
|
||||
function = function if function else inspect.stack()[function_level][3]
|
||||
@@ -1176,7 +1174,6 @@ def videolibrary(itemlist, item, typography='', function_level=1, function=''):
|
||||
url=item.url,
|
||||
action=action,
|
||||
from_action=item.action,
|
||||
extra=extra,
|
||||
path=item.path,
|
||||
thumbnail=thumb('add_to_videolibrary')
|
||||
))
|
||||
|
||||
+10
-12
@@ -687,11 +687,16 @@ def add_to_videolibrary(item, channel):
|
||||
|
||||
|
||||
def add_to_videolibrary(item, channel):
|
||||
itemlist = getattr(channel, item.from_action)(item)
|
||||
if itemlist and itemlist[0].contentType == 'episode':
|
||||
return add_tvshow(item, channel, itemlist)
|
||||
else:
|
||||
if item.contentType == 'movie':
|
||||
return add_movie(item)
|
||||
elif item.contentType == 'tvshow':
|
||||
return add_tvshow(item)
|
||||
else:
|
||||
itemlist = getattr(channel, item.from_action)(item)
|
||||
if itemlist and itemlist[0].contentType == 'episode':
|
||||
return add_tvshow(item, channel, itemlist)
|
||||
else:
|
||||
return add_movie(item)
|
||||
|
||||
|
||||
def add_movie(item):
|
||||
@@ -769,11 +774,6 @@ def add_tvshow(item, channel=None, itemlist=[]):
|
||||
itemlist = [item.clone()]
|
||||
|
||||
else:
|
||||
# This mark is because the item has something else apart in the "extra" attribute
|
||||
# item.action = item.extra if item.extra else item.action
|
||||
if isinstance(item.extra, str) and "###" in item.extra:
|
||||
item.action = item.extra.split("###")[0]
|
||||
item.extra = item.extra.split("###")[1]
|
||||
|
||||
if item.from_action:
|
||||
item.__dict__["action"] = item.__dict__.pop("from_action")
|
||||
@@ -811,7 +811,7 @@ def add_tvshow(item, channel=None, itemlist=[]):
|
||||
if not check(item, itemlist):
|
||||
action = item.action
|
||||
item.setrenumber = True
|
||||
start(item)
|
||||
start(itemlist, item)
|
||||
item.setrenumber = False
|
||||
item.action = action
|
||||
if not item.exit:
|
||||
@@ -820,8 +820,6 @@ def add_tvshow(item, channel=None, itemlist=[]):
|
||||
else:
|
||||
itemlist = getattr(channel, item.action)(item)
|
||||
|
||||
global magnet_caching
|
||||
magnet_caching = False
|
||||
|
||||
inserted, overwritten, failed, path = save_tvshow(item, itemlist)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user