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