Miglioria nella selezione della numerazione alternativa di TMDB

This commit is contained in:
Alhaziel01
2021-03-06 18:55:10 +01:00
parent c9127de030
commit 5070e32d65
3 changed files with 42 additions and 50 deletions

View File

@@ -565,16 +565,14 @@ def select_group(groups, item):
selected = -1
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))]
selections = [['Original',res.get('number_of_seasons',0), res.get('number_of_episodes',0), '', item.thumbnail]]
ids = ['original']
for group in groups:
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)
# name = '{} Seasons: {} Episodes: {}'.format(group.get('name',''), group.get('group_count',0), group.get('episode_count',0))
# description = group.get('description','')
ID = group.get('id','')
if ID:
selections.append(name)
selections.append([group.get('name',''), group.get('group_count',0), group.get('episode_count',0), group.get('description',''), item.thumbnail])
ids.append(ID)
if selections and ids:
selected = platformtools.dialog_select_group(config.get_localized_string(70831), selections)

View File

@@ -239,9 +239,14 @@ def dialog_select_group(heading, _list, preselect=0):
def onInit(self):
self.getControl(1).setText(self.heading)
itemlist = []
for n, text in enumerate(self.list):
for n, it in enumerate(self.list):
logger.debug(it)
item = xbmcgui.ListItem(str(n))
item.setProperty('title', text)
item.setProperty('title', it[0])
item.setProperty('seasons', str(it[1]))
item.setProperty('episodes', str(it[2]))
item.setProperty('description', '\n' + it[3])
item.setProperty('thumb', it[4])
itemlist.append(item)
self.getControl(2).addItems(itemlist)
@@ -496,7 +501,6 @@ def set_context_commands(item, item_url, parent_item, **kwargs):
2. Adding options according to criteria
Options can be added to the context menu to items that meet certain conditions.
3. Adding options to all items
Options can be added to the context menu for all items

View File

@@ -12,9 +12,9 @@
<controls>
<control type="group">
<description>Container</description>
<left>200</left>
<left>40</left>
<top>60</top>
<width>860</width>
<width>1200</width>
<height>600</height>
<control type="image">
<description>Background</description>
@@ -22,49 +22,56 @@
<height>100%</height>
<texture colordiffuse="FF232323">white.png</texture>
</control>
<control type="image">
<description>Poster</description>
<top>0</top>
<left>0</left>
<height>600</height>
<width>400</width>
<texture>$INFO[Container(2).ListItem.Property(thumb)]</texture>
</control>
<control type="textbox" id="1">
<description>Heading</description>
<top>0</top>
<left>0</left>
<height>60</height>
<width>100%</width>
<left>460</left>
<height>80</height>
<width>680</width>
<font>font13</font>
<textcolor>FFFFFFFF</textcolor>
<align>center</align>
<align>left</align>
<aligny>center</aligny>
<label></label>
</control>
<control type="group">
<left>30</left>
<top>70</top>
<width>795</width>
<height>530</height>
<left>440</left>
<top>80</top>
<width>720</width>
<height>480</height>
<control type="list" id="2">
<description>List</description>
<left>0</left>
<top>0</top>
<width>795</width>
<width>720</width>
<height>530</height>
<onup>100</onup>
<onright>4</onright>
<orientation>vertical</orientation>
<scrolltime>200</scrolltime>
<pagecontrol>4</pagecontrol>
<itemlayout height="150" width="795">
<itemlayout height="60" width="720">
<control type="textbox">
<description>Selected Item</description>
<left>20</left>
<top>20</top>
<width>765</width>
<height>110</height>
<top>0</top>
<width>680</width>
<height>60</height>
<font>font13</font>
<textcolor>FFFFFFFF</textcolor>
<label>$INFO[ListItem.Property(title)]</label>
<align>center</align>
<label>[B]$INFO[ListItem.Property(title)][/B] $ADDON[plugin.video.kod 30140]: $INFO[ListItem.Property(seasons)] $ADDON[plugin.video.kod 70362]: $INFO[ListItem.Property(episodes)]</label>
<align>left</align>
<aligny>center</aligny>
</control>
</itemlayout>
<focusedlayout height="150" width="795">
<focusedlayout height="200" width="720">
<control type="image">
<top>1</top>
<width>100%</width>
@@ -75,39 +82,22 @@
<description>Selected Item</description>
<left>20</left>
<top>20</top>
<width>765</width>
<height>110</height>
<width>680</width>
<height>160</height>
<font>font13</font>
<textcolor>FFFFFFFF</textcolor>
<label>$INFO[ListItem.Property(title)]</label>
<label>[B]$INFO[ListItem.Property(title)][/B] $ADDON[plugin.video.kod 30140]: $INFO[ListItem.Property(seasons)] $ADDON[plugin.video.kod 70362]: $INFO[ListItem.Property(episodes)]$INFO[ListItem.Property(description)]</label>
<autoscroll time="3000" delay="3000" repeat="3000">True</autoscroll>
<align>center</align>
<align>left</align>
<aligny>center</aligny>
</control>
</focusedlayout>
</control>
<control type="scrollbar" id="4">
<description>Scrollbar</description>
<left>800</left>
<top>0</top>
<width>5</width>
<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="FFFFFFFF">white.png</textureslidernib>
<textureslidernibfocus colordiffuse="FFFFFFFF">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>20</right>
<top>10</top>
<top>20</top>
<width>40</width>
<height>40</height>
<texturefocus colordiffuse="FFFFFFFF">close.png</texturefocus>