Alcune migliorie alla videoteca
This commit is contained in:
@@ -279,15 +279,19 @@ def dialog_select_group(heading, _list, preselect=0):
|
||||
|
||||
|
||||
def itemlist_refresh():
|
||||
# pos = Item().fromurl(xbmc.getInfoLabel('ListItem.FileNameAndPath')).itemlistPosition
|
||||
# logger.info('Current position: ' + str(pos))
|
||||
win = xbmcgui.Window(xbmcgui.getCurrentWindowId())
|
||||
cid = win.getFocusId()
|
||||
ctl = win.getControl(cid)
|
||||
pos = Item().fromurl(xbmc.getInfoLabel('ListItem.FileNameAndPath')).itemlistPosition
|
||||
|
||||
xbmc.executebuiltin("Container.Refresh")
|
||||
|
||||
# while Item().fromurl(xbmc.getInfoLabel('ListItem.FileNameAndPath')).itemlistPosition != pos:
|
||||
# win = xbmcgui.Window(xbmcgui.getCurrentWindowId())
|
||||
# cid = win.getFocusId()
|
||||
# ctl = win.getControl(cid)
|
||||
# ctl.selectItem(pos)
|
||||
while xbmcgui.getCurrentWindowDialogId() != 10138:
|
||||
pass
|
||||
while xbmcgui.getCurrentWindowDialogId() == 10138:
|
||||
pass
|
||||
|
||||
ctl.selectItem(pos)
|
||||
|
||||
|
||||
def itemlist_update(item, replace=False):
|
||||
@@ -354,17 +358,24 @@ def render_items(itemlist, parent_item):
|
||||
|
||||
icon_image = "DefaultFolder.png" if item.folder else "DefaultVideo.png"
|
||||
listitem = xbmcgui.ListItem(item.title)
|
||||
listitem.setArt({'icon': icon_image, 'thumb': item.thumbnail, 'poster': item.thumbnail,
|
||||
'fanart': item.fanart if item.fanart else default_fanart})
|
||||
art = {'icon': icon_image, 'thumb': item.thumbnail, 'poster': item.thumbnail, 'fanart': item.fanart if item.fanart else default_fanart}
|
||||
if item.landscape: art['landscape'] = item.landscape
|
||||
if item.clearlogo: art['clearlogo'] = item.clearlogo
|
||||
if item.clearart: art['clearart'] = item.clearart
|
||||
if item.banner: art['banner'] = item.banner
|
||||
listitem.setArt(art)
|
||||
|
||||
if config.get_setting("player_mode") == 1 and item.action == "play" and not item.nfo:
|
||||
listitem.setProperty('IsPlayable', 'true')
|
||||
|
||||
set_infolabels(listitem, item)
|
||||
|
||||
if item.infoLabels.get('castandrole'):
|
||||
cast = [{'name':c[0], 'role':c[1], 'thumbnail':c[2], 'order':c[3]} for c in item.infoLabels.get("castandrole", [])]
|
||||
cast.sort(key=lambda c: c['order'])
|
||||
listitem.setCast(cast)
|
||||
del item.infoLabels['castandrole']
|
||||
|
||||
set_infolabels(listitem, item)
|
||||
|
||||
|
||||
# context menu
|
||||
if parent_item.channel != 'special':
|
||||
@@ -453,11 +464,11 @@ def getCurrentView(item=None, parent_item=None):
|
||||
or (item.channel in ['videolibrary'] and parent_item.action in ['list_tvshows']):
|
||||
return 'tvshow', 'tvshows'
|
||||
|
||||
elif parent_item.action in ['get_seasons']:
|
||||
elif parent_item.action in ['get_seasons'] or item.contentType == 'season':
|
||||
return 'season', 'tvshows'
|
||||
|
||||
elif parent_item.action in ['episodios', 'get_episodes'] or item.contentType == 'episode':
|
||||
return 'episode', 'tvshows'
|
||||
return 'episode', 'episodes'
|
||||
|
||||
else:
|
||||
return 'menu', 'addons' if config.get_setting('touch_view') else ''
|
||||
@@ -517,6 +528,7 @@ def set_infolabels(listitem, item, player=False):
|
||||
'top250': 'top250', 'tracknumber': 'tracknumber', 'trailer': 'trailer', 'thumbnail': 'None',
|
||||
'tvdb_id': 'None', 'tvshowtitle': 'tvshowtitle', 'type': 'None', 'userrating': 'userrating',
|
||||
'url_scraper': 'None', 'votes': 'votes', 'writer': 'writer', 'year': 'year'}
|
||||
|
||||
if item.infoLabels:
|
||||
try:
|
||||
infoLabels_kodi = {infoLabels_dict[label_tag]: item.infoLabels[label_tag] for label_tag, label_value in list(item.infoLabels.items()) if infoLabels_dict[label_tag] != 'None' and label_tag in infoLabels_dict}
|
||||
|
||||
Reference in New Issue
Block a user