Fix Download Anime

This commit is contained in:
Alhaziel
2019-10-05 09:27:19 +02:00
parent 49d75fce7b
commit bbdb0df3fe
3 changed files with 25 additions and 19 deletions
+15 -9
View File
@@ -114,7 +114,7 @@ def manual_renumeration(item, modify=False):
dict_series[title] = dict_renumerate
# channel = __import__('channels.' + item.channel, fromlist=["channels.%s" % item.channel])
itemlist = get_episodes(item)
itemlist = find_episodes(item)
for item in itemlist:
Title = re.sub(r'\d+x\d+ - ', '', item.title)
if modify == True:
@@ -210,7 +210,7 @@ def semiautomatic_config_item(item):
jsontools.update_node(dict_series, item.channel, TAG_TVSHOW_RENUMERATE)[0]
_list = []
# channel = __import__('channels.' + item.channel, fromlist=["channels.%s" % item.channel])
itemlist = get_episodes(item)
itemlist = find_episodes(item)
for item in itemlist:
Title = re.sub(r'\d+x\d+ - ', '', item.title)
if item.action == 'findvideos':
@@ -287,6 +287,7 @@ def config_item(item, itemlist=[], typography='', active=False):
def renumber(itemlist, item='', typography=''):
log()
# dbg()
# Carica Impostazioni
if itemlist:
settings_node = jsontools.get_node_from_file(itemlist[0].channel, 'settings')
@@ -294,23 +295,28 @@ def renumber(itemlist, item='', typography=''):
settings_node = {}
try: dict_series = jsontools.get_node_from_file(itemlist[0].channel, TAG_TVSHOW_RENUMERATE)
except: dict_series = {}
log('CHANNEL', itemlist[0])
# Seleziona la funzione Adatta, Menu Contestuale o Rinumerazione
if item:
if 'from_channel' in item:
item.channel = item.from_channel if item.from_channel else item.channel
item.channel = item.from_channel if item.from_channel else item.channel
# Controlla se la Serie è già stata rinumerata
TITLE = item.fulltitle.rstrip() if item.fulltitle else item.contentTitle
if inspect.stack()[2][3] == 'get_episodes':
log('dict', dict_series)
log('TITLE ', TITLE)
log('TITLE EXIST? ', TITLE in dict_series)
log('HAS ID? ',dict_series[TITLE].has_key(TAG_ID))
if inspect.stack()[2][3] == 'find_episodes':
log('PRENDO ITEMLIST ',inspect.stack()[2][3])
return itemlist
elif dict_series.has_key(TITLE) and dict_series[TITLE].has_key(TAG_ID):
ID = dict_series[TITLE][TAG_ID]
EPISODE = dict_series[TITLE][TAG_EPISODE]
if dict_series[TITLE].has_key(TAG_SEASON): SEASON = dict_series[TITLE][TAG_SEASON]
else: SEASON = ''
if dict_series[TITLE].has_key(TAG_MODE): MODE = dict_series[TITLE][TAG_MODE]
else: MODE = False
@@ -349,7 +355,7 @@ def renumber(itemlist, item='', typography=''):
item.context = context(exist)
def renumeration (itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE, TITLE, TYPE):
# Se ID è 0 salta la rinumerazione
if ID == '0':
return itemlist
@@ -543,7 +549,7 @@ def check(item):
exist = False
return exist
def get_episodes(item):
def find_episodes(item):
log()
ch = __import__('channels.' + item.channel, fromlist=["channels.%s" % item.channel])
itemlist = ch.episodios(item)
+3 -3
View File
@@ -811,11 +811,11 @@ def save_download(item):
if item.from_action and item.from_channel:
item.channel = item.from_channel
item.action = item.from_action
del item.from_action
del item.from_channel
item.from_action
item.from_channel
item.contentChannel = item.from_channel if item.from_channel else item.channel
item.contentAction = item.fromaction if item.fromaction else item.action
item.contentAction = item.from_action if item.from_action else item.action
if item.contentType in ["tvshow", "episode", "season"]:
if 'download' in item: