Fix Rinumerazione
This commit is contained in:
@@ -168,7 +168,7 @@ def semiautomatic_config_item(item):
|
|||||||
tvdb.find_and_set_infoLabels(item)
|
tvdb.find_and_set_infoLabels(item)
|
||||||
item.channel = item.from_channel
|
item.channel = item.from_channel
|
||||||
dict_series = jsontools.get_node_from_file(item.channel, TAG_TVSHOW_RENUMERATE)
|
dict_series = jsontools.get_node_from_file(item.channel, TAG_TVSHOW_RENUMERATE)
|
||||||
title = item.show
|
title = item.show if item.show else item.fulltitle
|
||||||
|
|
||||||
# Trova l'ID della serie
|
# Trova l'ID della serie
|
||||||
while not item.infoLabels['tvdb_id']:
|
while not item.infoLabels['tvdb_id']:
|
||||||
@@ -248,7 +248,7 @@ def semiautomatic_config_item(item):
|
|||||||
def config_item(item, itemlist=[], typography='', active=False):
|
def config_item(item, itemlist=[], typography='', active=False):
|
||||||
log()
|
log()
|
||||||
# Configurazione Automatica, Tenta la numerazione Automatica degli episodi
|
# Configurazione Automatica, Tenta la numerazione Automatica degli episodi
|
||||||
title = item.fulltitle
|
title = item.show if item.show else item.fulltitle
|
||||||
|
|
||||||
dict_series = jsontools.get_node_from_file(item.channel, TAG_TVSHOW_RENUMERATE)
|
dict_series = jsontools.get_node_from_file(item.channel, TAG_TVSHOW_RENUMERATE)
|
||||||
try: ID = dict_series[item.show.rstrip()][TAG_ID]
|
try: ID = dict_series[item.show.rstrip()][TAG_ID]
|
||||||
@@ -298,18 +298,18 @@ def renumber(itemlist, item='', typography=''):
|
|||||||
if item:
|
if 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
|
# Controlla se la Serie è già stata rinumerata
|
||||||
TITLE = item.fulltitle.rstrip() if item.fulltitle else item.contentTitle
|
TITLE = item.show.rstrip() if item.show else item.contentTitle
|
||||||
|
|
||||||
if inspect.stack()[2][3] == 'find_episodes':
|
if inspect.stack()[2][3] == 'find_episodes':
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
elif dict_series.has_key(TITLE) and dict_series[TITLE].has_key(TAG_ID):
|
elif dict_series.has_key(TITLE) and dict_series[TITLE].has_key(TAG_ID):
|
||||||
ID = dict_series[TITLE][TAG_ID]
|
ID = dict_series[TITLE][TAG_ID]
|
||||||
EPISODE = dict_series[TITLE][TAG_EPISODE]
|
EPISODE = dict_series[TITLE][TAG_EPISODE]
|
||||||
|
|
||||||
if dict_series[TITLE].has_key(TAG_SEASON): SEASON = dict_series[TITLE][TAG_SEASON]
|
if dict_series[TITLE].has_key(TAG_SEASON): SEASON = dict_series[TITLE][TAG_SEASON]
|
||||||
else: SEASON = ''
|
else: SEASON = ''
|
||||||
|
|
||||||
if dict_series[TITLE].has_key(TAG_MODE): MODE = dict_series[TITLE][TAG_MODE]
|
if dict_series[TITLE].has_key(TAG_MODE): MODE = dict_series[TITLE][TAG_MODE]
|
||||||
else: MODE = False
|
else: MODE = False
|
||||||
|
|
||||||
@@ -348,7 +348,7 @@ def renumber(itemlist, item='', typography=''):
|
|||||||
item.context = context(exist)
|
item.context = context(exist)
|
||||||
|
|
||||||
def renumeration (itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE, TITLE, TYPE):
|
def renumeration (itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE, TITLE, TYPE):
|
||||||
|
|
||||||
# Se ID è 0 salta la rinumerazione
|
# Se ID è 0 salta la rinumerazione
|
||||||
if ID == '0':
|
if ID == '0':
|
||||||
return itemlist
|
return itemlist
|
||||||
@@ -370,7 +370,7 @@ def renumeration (itemlist, item, typography, dict_series, ID, SEASON, EPISODE,
|
|||||||
# Controlla che la lista egli Episodi sia della stessa lunghezza di Itemlist
|
# Controlla che la lista egli Episodi sia della stessa lunghezza di Itemlist
|
||||||
if EpisodeDict == 'none':
|
if EpisodeDict == 'none':
|
||||||
return error(itemlist)
|
return error(itemlist)
|
||||||
if TYPE == 'manual' and len(EpisodeDict) < len(itemlist):
|
if TYPE == 'manual' and len(EpisodeDict) < len(itemlist):
|
||||||
EpisodeDict = manual_renumeration(item, True)
|
EpisodeDict = manual_renumeration(item, True)
|
||||||
if len(EpisodeDict) >= len(itemlist) and EpisodeDict.has_key(scrapertoolsV2.find_single_match(itemlist[0].title, r'\d+')):
|
if len(EpisodeDict) >= len(itemlist) and EpisodeDict.has_key(scrapertoolsV2.find_single_match(itemlist[0].title, r'\d+')):
|
||||||
for item in itemlist:
|
for item in itemlist:
|
||||||
@@ -534,7 +534,7 @@ def error(itemlist):
|
|||||||
def check(item):
|
def check(item):
|
||||||
try:
|
try:
|
||||||
dict_series = jsontools.get_node_from_file(item.channel, TAG_TVSHOW_RENUMERATE)
|
dict_series = jsontools.get_node_from_file(item.channel, TAG_TVSHOW_RENUMERATE)
|
||||||
TITLE = item.fulltitle.rstrip()
|
TITLE = item.show.rstrip()
|
||||||
dict_series[TITLE][TAG_ID]
|
dict_series[TITLE][TAG_ID]
|
||||||
dict_series[TITLE][TAG_EPISODE]
|
dict_series[TITLE][TAG_EPISODE]
|
||||||
exist = True
|
exist = True
|
||||||
|
|||||||
Reference in New Issue
Block a user