Fix TMDB con selezione Numerazione

This commit is contained in:
Alhaziel01
2021-02-02 12:08:41 +01:00
parent 058b3ed507
commit a9c6dac6f4
6 changed files with 170 additions and 2 deletions

View File

@@ -547,8 +547,9 @@ def get_nfo(item, search_groups=False):
if groups:
Id = select_group(groups)
if Id:
info_nfo = 'https://www.themoviedb.org/tv/{}/episode_group/{}'.format(item.infoLabels['tmdb_id'], Id)
info_nfo = 'https://www.themoviedb.org/tv/{}/episode_group/{}\n'.format(item.infoLabels['tmdb_id'], Id)
return info_nfo
else: return
if "season" in item.infoLabels and "episode" in item.infoLabels:
info_nfo = "https://www.themoviedb.org/tv/%s/season/%s/episode/%s\n" % (item.infoLabels['tmdb_id'], item.contentSeason, item.contentEpisodeNumber)
@@ -576,7 +577,7 @@ def select_group(groups):
selections.append(name)
ids.append(ID)
if selections and ids:
selected = platformtools.dialog_select('Seleziona', selections)
selected = platformtools.dialog_select_group(config.get_localized_string(70831), selections)
if selected > -1:
return ids[selected]
return ''

View File

@@ -500,6 +500,8 @@ def save_tvshow(item, episodelist, silent=False):
# We create tvshow.nfo, if it does not exist, with the head_nfo, series info and watched episode marks
logger.debug("Creating tvshow.nfo: " + tvshow_path)
head_nfo = scraper.get_nfo(item, search_groups=True)
if not head_nfo:
return 0, 0, 0, path
item.infoLabels['mediatype'] = "tvshow"
item.infoLabels['title'] = item.contentSerieName
item_tvshow = Item(title=item.contentSerieName, channel="videolibrary", action="get_seasons",

View File

@@ -226,6 +226,45 @@ def dialog_info(item, scraper):
dialog = TitleOrIDWindow('TitleOrIDWindow.xml', config.get_runtime_path()).Start(item, scraper)
return dialog
def dialog_select_group(heading, _list, preselect=0):
class SelectGroup(xbmcgui.WindowXMLDialog):
def start(self, heading, _list, preselect):
self.selected = preselect
self.heading = heading
self.list = _list
self.doModal()
return self.selected
def onInit(self):
self.getControl(1).setText(self.heading)
itemlist = []
for n, text in enumerate(self.list):
item = xbmcgui.ListItem(str(n))
item.setProperty('title', text)
itemlist.append(item)
self.getControl(2).addItems(itemlist)
self.setFocusId(2)
self.getControl(2).selectItem(self.selected)
def onClick(self, control):
if control in [100]:
self.selected = -1
self.close()
elif control in [2]:
self.selected = self.getControl(2).getSelectedPosition()
self.close()
def onAction(self, action):
action = action.getId()
if action in [10, 92]:
self.selected = -1
self.close()
dialog = SelectGroup('SelectGroup.xml', config.get_runtime_path()).start(heading, _list, preselect)
return dialog
def itemlist_refresh():
# pos = Item().fromurl(xbmc.getInfoLabel('ListItem.FileNameAndPath')).itemlistPosition

View File

@@ -6123,6 +6123,9 @@ msgctxt "#70830"
msgid "The series / episode number should only be changed if the series has relative numbering."
msgstr ""
msgctxt "#70831"
msgid "This series has multiple types of numbering, choose the most suitable one "
msgstr ""
# DNS start [ settings and declaration ]
msgctxt "#707401"

View File

@@ -6124,6 +6124,10 @@ msgctxt "#70830"
msgid "The series / episode number should only be changed if the series has relative numbering."
msgstr "Il numero della serie / episodio deve essere modificato solo se la serie ha una numerazione relativa."
msgctxt "#70831"
msgid "This series has multiple types of numbering, choose the most suitable one "
msgstr "Questa serie ha più tipi di numerazione, scegli quello più adatto"
# DNS start [ settings and declaration ]
msgctxt "#707401"
msgid "Enable DNS check alert"

View File

@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="utf-8"?>
<window>
<allowoverlays>false</allowoverlays>
<animation type="WindowOpen" reversible="false">
<effect type="slide" start="0,200" end="0,0" center="640,225" delay="160" tween="cubic" time="200" />
<effect type="fade" delay="160" end="100" time="240" />
</animation>
<animation type="WindowClose" reversible="false">
<effect type="slide" start="0,0" end="0,200" center="640,225" easing="in" tween="cubic" time="200" />
<effect type="fade" start="100" end="0" time="240" />
</animation>
<controls>
<control type="group">
<description>Container</description>
<left>200</left>
<top>60</top>
<width>860</width>
<height>600</height>
<control type="image">
<description>Background</description>
<width>100%</width>
<height>100%</height>
<texture colordiffuse="FF232323">white.png</texture>
</control>
<control type="textbox" id="1">
<description>Heading</description>
<top>0</top>
<left>0</left>
<height>60</height>
<width>100%</width>
<font>font13</font>
<textcolor>FFFFFFFF</textcolor>
<align>center</align>
<aligny>center</aligny>
<label></label>
</control>
<control type="group">
<left>30</left>
<top>70</top>
<width>595</width>
<height>530</height>
<control type="list" id="2">
<description>List</description>
<left>0</left>
<top>0</top>
<width>795</width>
<height>530</height>
<onup>100</onup>
<onright>4</onright>
<orientation>vertical</orientation>
<scrolltime>200</scrolltime>
<pagecontrol>4</pagecontrol>
<itemlayout height="150" width="795">
<control type="textbox">
<description>Selected Item</description>
<left>20</left>
<top>20</top>
<width>765</width>
<height>110</height>
<font>font13</font>
<textcolor>FFFFFFFF</textcolor>
<label>$INFO[ListItem.Property(title)]</label>
<align>center</align>
<aligny>center</aligny>
</control>
</itemlayout>
<focusedlayout height="150" width="795">
<control type="image">
<top>1</top>
<width>100%</width>
<height>100%</height>
<texture colordiffuse="FF0081C2">white.png</texture>
</control>
<control type="textbox">
<description>Selected Item</description>
<left>20</left>
<top>20</top>
<width>765</width>
<height>110</height>
<font>font13</font>
<textcolor>FFFFFFFF</textcolor>
<label>$INFO[ListItem.Property(title)]</label>
<autoscroll time="3000" delay="3000" repeat="3000">True</autoscroll>
<align>center</align>
<aligny>center</aligny>
</control>
</focusedlayout>
</control>
<control type="scrollbar" id="4">
<description>Scrollbar</description>
<left>595</left>
<top>60</top>
<width>5</width>
<height>100%</height>
<visible>true</visible>
<texturesliderbackground colordiffuse="FF232323">white.png</texturesliderbackground>
<texturesliderbar colordiffuse="FFFFFFFF">white.png</texturesliderbar>
<texturesliderbarfocus colordiffuse="FF0081C2">white.png</texturesliderbarfocus>
<textureslidernib colordiffuse="FF232323">white.png</textureslidernib>
<textureslidernibfocus colordiffuse="FF232323">white.png</textureslidernibfocus>
<orientation>vertical</orientation>
<showonepage>false</showonepage>
<onleft>2</onleft>
<onright>3</onright>
</control>
</control>
<control type="button" id="100">
<description>Close Button</description>
<right>30</right>
<top>10</top>
<width>40</width>
<height>40</height>
<texturefocus colordiffuse="FFFFFFFF">close.png</texturefocus>
<texturenofocus colordiffuse="55FFFFFF">close.png</texturenofocus>
<ondown>2</ondown>
</control>
</control>
</controls>
</window>