aggiornamento ricerca alternativa

This commit is contained in:
Alhaziel01
2021-09-25 11:12:31 +02:00
parent 32d88dc77c
commit 3838a22089
18 changed files with 776 additions and 415 deletions

View File

@@ -75,6 +75,7 @@ class InfoPlus(xbmcgui.WindowXML):
else:
self.listitem.setArt({'poster':self.item.thumbnail, 'fanart':self.item.fanart})
# Set Rating
if 'trakt_rating' in self.info: self.info['rating'] = self.info['trakt_rating']
self.listitem.setProperty('rating',str(int(self.info.get('rating',10) * 10)))
rating = self.info.get('rating', 'N/A')
color = 'FFFFFFFF' if rating == 'N/A' else 'FFDB2360' if rating < 4 else 'FFD2D531' if rating < 7 else 'FF21D07A'
@@ -303,7 +304,12 @@ class CastWindow(xbmcgui.WindowXML):
def get_person_info(self):
# Function for Person Info
url = '{}/person/{}?api_key={}&language=en'.format(tmdb.host, self.id, tmdb.api)
if not self.id and self.item.text:
res = httptools.downloadpage('{}/search/person?api_key={}&language={}&query={}'.format(tmdb.host, tmdb.api, tmdb.def_lang, self.item.text)).json.get('results',[])
if res: self.id = res[0]['id']
else: self.close()
url = '{}/person/{}?api_key={}&language={}'.format(tmdb.host, self.id, tmdb.api, tmdb.def_lang)
translation_url = '{}/person/{}/translations?api_key={}'.format(tmdb.host, self.id, tmdb.api)
info = httptools.downloadpage(url).json
@@ -322,7 +328,7 @@ class CastWindow(xbmcgui.WindowXML):
place = info.get('place_of_birth')
self.castitem = xbmcgui.ListItem(info.get('name'))
birth = born + (' - ' + dead if dead else '') + (' [B]•[/B] ' + place if place else '')
self.castitem.setArt({'poster':self.item.poster if self.item.poster else self.item.infoLabels.get('thumbnail', '')})
self.castitem.setArt({'poster':self.item.poster if self.item.poster else self.item.infoLabels.get('thumbnail', self.item.thumbnail)})
self.castitem.setProperties({'birth':birth, 'plot':biography})
def onInit(self):

View File

@@ -67,6 +67,7 @@ def run(item=None):
config.set_setting('show_once', True)
logger.info(item.tostring())
# from core.support import dbg;dbg()
try:
if not config.get_setting('tmdb_active'):
@@ -116,6 +117,11 @@ def run(item=None):
action = getattr(infoplus, item.action)
return action(item)
elif item.channel == 'trakt_tools':
from core import trakt_tools
action = getattr(trakt_tools, item.action)
return action(item)
elif item.channel == "backup":
from platformcode import backup
return getattr(backup, item.action)(item)

View File

@@ -474,10 +474,10 @@ def render_items(itemlist, parent_item):
xbmc.sleep(100)
xbmc.sleep(100)
win = xbmcgui.Window(10025)
cid = win.getFocusId()
ctl = win.getControl(cid)
ctrlId = win.getFocusId()
ctrl = win.getControl(ctrlId)
pos = position + (1 if xbmc.getInfoLabel('Container(10138).HasParent') else 0)
ctl.selectItem(pos)
ctrl.selectItem(pos)
def viewmodeMonitor():
@@ -680,7 +680,8 @@ def set_context_commands(item, item_url, parent_item, **kwargs):
# (item.contentTitle and item.infoLabels["year"]) or item.contentSerieName:
if item.infoLabels['tmdb_id'] or item.infoLabels['imdb_id'] or item.infoLabels['tvdb_id']:
context_commands.append(("InfoPlus", "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'channel=infoplus&action=start&from_channel=' + item.channel)))
if config.get_setting("token_trakt", "trakt") and item.contentType in ['movie', 'tvshow']:
context_commands.append((config.get_localized_string(70318), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'channel=trakt_tools&action=context')))
# Open in browser and previous menu
if parent_item.channel not in ["news", "channelselector", "downloads", "search"] and item.action != "mainlist" and not parent_item.noMainMenu:
context_commands.insert(1, (config.get_localized_string(70739), "Container.Update (%s?%s)" % (sys.argv[0], Item(action="open_browser", url=item.url).tourl())))
@@ -1353,20 +1354,6 @@ def get_selected_video(item, selection, video_urls, autoplay=False):
file_type = video_url.get('type', 'Video').lower()
if not item.subtitle: item.subtitle = video_url.get('sub', '')
view = True
# if selection < len(video_urls):
# mediaurl = video_urls[selection][1]
# if len(video_urls[selection]) > 4:
# wait_time = video_urls[selection][2]
# if not item.subtitle:
# item.subtitle = video_urls[selection][3]
# mpd = True
# elif len(video_urls[selection]) > 3:
# wait_time = video_urls[selection][2]
# if not item.subtitle:
# item.subtitle = video_urls[selection][3]
# elif len(video_urls[selection]) > 2:
# wait_time = video_urls[selection][2]
# view = True
if 'mpd' in file_type:
mpd = True

View File

@@ -271,7 +271,6 @@ def mark_content_as_watched_on_kodi(item, value=1):
payload = {"jsonrpc": "2.0", "method": "VideoLibrary.SetMovieDetails", "params": {"movieid": r[0][0], "playcount": value}, "id": 1}
data = get_data(payload)
elif item.contentType == 'episode':
from core.support import dbg;dbg()
path = '%{}'.format(item.strm_path.replace('\\','%').replace('/', '%'))
sql = 'select idEpisode from episode_view where c18 like "{}"'.format(path)