Fix and improvements fo autorenumber
This commit is contained in:
@@ -59,7 +59,11 @@ def add_season(data=None):
|
|||||||
if season != "":
|
if season != "":
|
||||||
heading = config.get_localized_string(70687)
|
heading = config.get_localized_string(70687)
|
||||||
episode = platformtools.dialog_numeric(0, heading)
|
episode = platformtools.dialog_numeric(0, heading)
|
||||||
if episode != "":
|
if episode == "0":
|
||||||
|
heading = config.get_localized_string(70688)
|
||||||
|
special = platformtools.dialog_numeric(0, heading)
|
||||||
|
return [int(season), int(episode), int(special)]
|
||||||
|
elif episode != '':
|
||||||
return [int(season), int(episode)]
|
return [int(season), int(episode)]
|
||||||
|
|
||||||
|
|
||||||
@@ -90,14 +94,19 @@ def write_data(channel, show, data):
|
|||||||
|
|
||||||
def renumber(itemlist, item='', typography=''):
|
def renumber(itemlist, item='', typography=''):
|
||||||
log()
|
log()
|
||||||
|
# log(itemlist)
|
||||||
|
# key_list= item.title
|
||||||
|
# sorted_list = sorted(itemlist, key=key_list)
|
||||||
|
# log(sorted_list)
|
||||||
|
|
||||||
if item:
|
if 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)
|
||||||
SERIES = dict_series[item.show]['season_episode']
|
SERIES = dict_series[item.show.rstrip()]['season_episode']
|
||||||
S = SERIES[0]
|
S = SERIES[0]
|
||||||
E = SERIES[1]
|
E = SERIES[1]
|
||||||
ID = SERIES[2]
|
SP = SERIES[2]
|
||||||
|
ID = SERIES[3]
|
||||||
|
|
||||||
page = 1
|
page = 1
|
||||||
epList = []
|
epList = []
|
||||||
@@ -111,18 +120,23 @@ def renumber(itemlist, item='', typography=''):
|
|||||||
for episodes in data['data']:
|
for episodes in data['data']:
|
||||||
if episodes['airedSeason'] >= S:
|
if episodes['airedSeason'] >= S:
|
||||||
if E == 0:
|
if E == 0:
|
||||||
epList.append(str(episodes['airedSeason']) + 'x0')
|
epList.append([0, SP])
|
||||||
E = 1
|
E = 1
|
||||||
if episodes['airedEpisodeNumber'] >= E:
|
if episodes['airedEpisodeNumber'] >= E:
|
||||||
epList.append(str(episodes['airedSeason']) + 'x' + str(episodes['airedEpisodeNumber']))
|
epList.append([episodes['airedSeason'], episodes['airedEpisodeNumber']])
|
||||||
page = page + 1
|
page = page + 1
|
||||||
else:
|
else:
|
||||||
exist = False
|
exist = False
|
||||||
|
|
||||||
|
epList.sort()
|
||||||
ep = 0
|
ep = 0
|
||||||
|
|
||||||
for item in itemlist:
|
for item in itemlist:
|
||||||
item.title = typo(epList[ep] + ' - ', typography) + item.title
|
s = str(epList[ep][0])
|
||||||
|
e = str(epList[ep][1])
|
||||||
|
item.title = typo(s + 'x'+ e + ' - ', typography) + item.title
|
||||||
ep = ep + 1
|
ep = ep + 1
|
||||||
|
|
||||||
except:
|
except:
|
||||||
return itemlist
|
return itemlist
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -10436,3 +10436,7 @@ msgstr ""
|
|||||||
msgctxt "#70687"
|
msgctxt "#70687"
|
||||||
msgid "Enter the number of the starting episode"
|
msgid "Enter the number of the starting episode"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
msgctxt "#70688"
|
||||||
|
msgid "Episode 0 is a special episode, enter the number of this episode"
|
||||||
|
msgstr ""
|
||||||
@@ -5425,3 +5425,7 @@ msgstr "Inserisci il numero della stagione di partenza"
|
|||||||
msgctxt "#70687"
|
msgctxt "#70687"
|
||||||
msgid "Enter the number of the starting episode"
|
msgid "Enter the number of the starting episode"
|
||||||
msgstr "Inserisci il numero dell'episodio di partenza"
|
msgstr "Inserisci il numero dell'episodio di partenza"
|
||||||
|
|
||||||
|
msgctxt "#70688"
|
||||||
|
msgid "Episode 0 is a special episode, enter the number of this episode"
|
||||||
|
msgstr "L'episodio 0 è un episodio speciale, inserisci il numero di questo episodio"
|
||||||
Reference in New Issue
Block a user