Fix TMDB
This commit is contained in:
+10
-6
@@ -533,8 +533,10 @@ def get_nfo(item, search_groups=False):
|
|||||||
groups = get_groups(item)
|
groups = get_groups(item)
|
||||||
|
|
||||||
if groups:
|
if groups:
|
||||||
Id = select_group(groups)
|
Id = select_group(groups, item)
|
||||||
if Id:
|
if Id == 'original':
|
||||||
|
pass
|
||||||
|
elif Id :
|
||||||
info_nfo = 'https://www.themoviedb.org/tv/{}/episode_group/{}\n'.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
|
return info_nfo
|
||||||
else: return
|
else: return
|
||||||
@@ -551,12 +553,14 @@ def get_groups(item):
|
|||||||
groups = requests.get(url).json().get('results',[])
|
groups = requests.get(url).json().get('results',[])
|
||||||
return groups
|
return groups
|
||||||
|
|
||||||
def select_group(groups):
|
def select_group(groups, item):
|
||||||
selected = -1
|
selected = -1
|
||||||
selections = []
|
url = 'https://api.themoviedb.org/3/tv/{}?api_key=a1ab8b8669da03637a4b98fa39c39228&language={}'.format(item.infoLabels['tmdb_id'], def_lang)
|
||||||
ids = []
|
res = requests.get(url).json()
|
||||||
|
selections = ['[B]Original[/B] Seasons: {} Episodes: {}'.format(res.get('number_of_seasons',0), res.get('number_of_episodes',0))]
|
||||||
|
ids = ['original']
|
||||||
for group in groups:
|
for group in groups:
|
||||||
name = '[B]{}[/B] Seasons: {} Episodes: {}'.format(group.get('name',''), group.get('group_count',''), group.get('episode_count',''))
|
name = '[B]{}[/B] Seasons: {} Episodes: {}'.format(group.get('name',''), group.get('group_count',0), group.get('episode_count',0))
|
||||||
description = group.get('description','')
|
description = group.get('description','')
|
||||||
if description:
|
if description:
|
||||||
name = '{}\n{}'.format(name, description)
|
name = '{}\n{}'.format(name, description)
|
||||||
|
|||||||
@@ -200,9 +200,9 @@ class autorenumber():
|
|||||||
Id = None
|
Id = None
|
||||||
groups = tmdb.get_groups(self.item)
|
groups = tmdb.get_groups(self.item)
|
||||||
if groups:
|
if groups:
|
||||||
Id = tmdb.select_group(groups)
|
Id = tmdb.select_group(groups, self.item)
|
||||||
|
|
||||||
if Id:
|
if Id and Id != 'original':
|
||||||
self.group = 'https://www.themoviedb.org/tv/{}/episode_group/{}'.format(self.item.infoLabels['tmdb_id'], Id)
|
self.group = 'https://www.themoviedb.org/tv/{}/episode_group/{}'.format(self.item.infoLabels['tmdb_id'], Id)
|
||||||
seasons = []
|
seasons = []
|
||||||
groupedSeasons = tmdb.get_group(Id)
|
groupedSeasons = tmdb.get_group(Id)
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
<control type="group">
|
<control type="group">
|
||||||
<left>30</left>
|
<left>30</left>
|
||||||
<top>70</top>
|
<top>70</top>
|
||||||
<width>595</width>
|
<width>795</width>
|
||||||
<height>530</height>
|
<height>530</height>
|
||||||
<control type="list" id="2">
|
<control type="list" id="2">
|
||||||
<description>List</description>
|
<description>List</description>
|
||||||
@@ -88,16 +88,16 @@
|
|||||||
</control>
|
</control>
|
||||||
<control type="scrollbar" id="4">
|
<control type="scrollbar" id="4">
|
||||||
<description>Scrollbar</description>
|
<description>Scrollbar</description>
|
||||||
<left>595</left>
|
<left>800</left>
|
||||||
<top>60</top>
|
<top>0</top>
|
||||||
<width>5</width>
|
<width>5</width>
|
||||||
<height>100%</height>
|
<height>470</height>
|
||||||
<visible>true</visible>
|
<visible>true</visible>
|
||||||
<texturesliderbackground colordiffuse="FF232323">white.png</texturesliderbackground>
|
<texturesliderbackground colordiffuse="FF232323">white.png</texturesliderbackground>
|
||||||
<texturesliderbar colordiffuse="FFFFFFFF">white.png</texturesliderbar>
|
<texturesliderbar colordiffuse="FFFFFFFF">white.png</texturesliderbar>
|
||||||
<texturesliderbarfocus colordiffuse="FF0081C2">white.png</texturesliderbarfocus>
|
<texturesliderbarfocus colordiffuse="FF0081C2">white.png</texturesliderbarfocus>
|
||||||
<textureslidernib colordiffuse="FF232323">white.png</textureslidernib>
|
<textureslidernib colordiffuse="FFFFFFFF">white.png</textureslidernib>
|
||||||
<textureslidernibfocus colordiffuse="FF232323">white.png</textureslidernibfocus>
|
<textureslidernibfocus colordiffuse="FFFFFFFF">white.png</textureslidernibfocus>
|
||||||
<orientation>vertical</orientation>
|
<orientation>vertical</orientation>
|
||||||
<showonepage>false</showonepage>
|
<showonepage>false</showonepage>
|
||||||
<onleft>2</onleft>
|
<onleft>2</onleft>
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
</control>
|
</control>
|
||||||
<control type="button" id="100">
|
<control type="button" id="100">
|
||||||
<description>Close Button</description>
|
<description>Close Button</description>
|
||||||
<right>30</right>
|
<right>20</right>
|
||||||
<top>10</top>
|
<top>10</top>
|
||||||
<width>40</width>
|
<width>40</width>
|
||||||
<height>40</height>
|
<height>40</height>
|
||||||
|
|||||||
Reference in New Issue
Block a user