Aggiornamento Selezione Visualizzazione
This commit is contained in:
@@ -209,8 +209,9 @@ def render_items(itemlist, parent_item):
|
|||||||
|
|
||||||
xbmcplugin.setPluginCategory(handle=_handle, category=breadcrumb)
|
xbmcplugin.setPluginCategory(handle=_handle, category=breadcrumb)
|
||||||
# from core.support import dbg;dbg()
|
# from core.support import dbg;dbg()
|
||||||
|
|
||||||
set_view_mode(item, parent_item)
|
set_view_mode(item, parent_item)
|
||||||
|
|
||||||
xbmcplugin.endOfDirectory(_handle)
|
xbmcplugin.endOfDirectory(_handle)
|
||||||
# Fijar la vista
|
# Fijar la vista
|
||||||
if config.get_setting("forceview"):
|
if config.get_setting("forceview"):
|
||||||
@@ -222,50 +223,50 @@ def render_items(itemlist, parent_item):
|
|||||||
|
|
||||||
|
|
||||||
def set_view_mode(item, parent_item):
|
def set_view_mode(item, parent_item):
|
||||||
# from core.support import dbg;dbg()
|
def mode(content, Type):
|
||||||
if (item.contentType in ['movie'] and parent_item.action in ['peliculas']) \
|
# from core.support import dbg;dbg()
|
||||||
or (item.channel in ['videolibrary'] and parent_item.action in ['list_movies']):
|
mode = int(config.get_setting('view_mode_%s' % content).split(',')[-1])
|
||||||
mode = config.get_setting('view_mode_movie')
|
|
||||||
if mode > 0:
|
if mode > 0:
|
||||||
xbmcplugin.setContent(handle=int(sys.argv[1]), content='movies')
|
xbmcplugin.setContent(handle=int(sys.argv[1]), content=Type)
|
||||||
xbmc.executebuiltin('Container.SetViewMode(%s)' % mode)
|
|
||||||
elif (item.contentType in ['tvshow'] and parent_item.action in ['peliculas']) \
|
|
||||||
or (item.channel in ['videolibrary'] and parent_item.action in ['list_tvshows']):
|
|
||||||
mode = config.get_setting('view_mode_tvshow')
|
|
||||||
if mode > 0:
|
|
||||||
xbmcplugin.setContent(handle=int(sys.argv[1]), content='tvshows')
|
|
||||||
xbmc.executebuiltin('Container.SetViewMode(%s)' % mode)
|
|
||||||
elif parent_item.action in ['get_seasons']:
|
|
||||||
mode = config.get_setting('view_mode_season')
|
|
||||||
if mode > 0:
|
|
||||||
xbmcplugin.setContent(handle=int(sys.argv[1]), content='tvshows')
|
|
||||||
xbmc.executebuiltin('Container.SetViewMode(%s)' % mode)
|
|
||||||
elif parent_item.action in ['episodios', 'get_episodes']:
|
|
||||||
mode = config.get_setting('view_mode_episode')
|
|
||||||
if mode > 0:
|
|
||||||
xbmcplugin.setContent(handle=int(sys.argv[1]), content='tvshows')
|
|
||||||
xbmc.executebuiltin('Container.SetViewMode(%s)' % mode)
|
|
||||||
elif parent_item.action == 'findvideos':
|
|
||||||
mode = config.get_setting('view_mode_server')
|
|
||||||
if mode > 0:
|
|
||||||
xbmcplugin.setContent(handle=int(sys.argv[1]), content='addons')
|
|
||||||
xbmc.executebuiltin('Container.SetViewMode(%s)' % mode)
|
|
||||||
else:
|
|
||||||
mode = config.get_setting('view_mode_addon')
|
|
||||||
if mode > 0:
|
|
||||||
xbmcplugin.setContent(handle=int(sys.argv[1]), content='addons')
|
|
||||||
xbmc.executebuiltin('Container.SetViewMode(%s)' % mode)
|
xbmc.executebuiltin('Container.SetViewMode(%s)' % mode)
|
||||||
|
logger.info('TYPE: ' + Type)
|
||||||
else:
|
else:
|
||||||
xbmcplugin.setContent(handle=int(sys.argv[1]), content='')
|
xbmcplugin.setContent(handle=int(sys.argv[1]), content='')
|
||||||
# content = 'movies' if item.contentType in ['movie'] and parent_item.action == 'peliculas'\
|
xbmc.executebuiltin('Container.SetViewMode(%s)' % 55)
|
||||||
# else 'tvshows' if item.contentType in ['tvshow'] and parent_item.action == 'peliculas' \
|
logger.info('TYPE: ' + 'None')
|
||||||
# else 'tvshows' if parent_item.action == 'episodios' \
|
|
||||||
# else 'addons' if parent_item.action in ['findvideos'] \
|
def reset_view_mode():
|
||||||
# else 'addons'
|
for mode in ['addon','channel','movie','tvshow','season','episode','server']:
|
||||||
|
config.set_setting('view_mode_%s' % mode, config.get_localized_string(70003) + ' , 0')
|
||||||
|
|
||||||
|
if xbmc.getSkinDir() != config.get_setting('skin_name') or not config.get_setting('skin_name'):
|
||||||
|
reset_view_mode()
|
||||||
|
xbmcplugin.setContent(handle=int(sys.argv[1]), content='')
|
||||||
|
xbmc.executebuiltin('Container.SetViewMode(%s)' % 55)
|
||||||
|
|
||||||
|
elif (item.contentType in ['movie'] and parent_item.action in ['peliculas']) \
|
||||||
|
or (item.channel in ['videolibrary'] and parent_item.action in ['list_movies']):
|
||||||
|
mode('movie', 'movies')
|
||||||
|
|
||||||
|
elif (item.contentType in ['tvshow'] and parent_item.action in ['peliculas']) \
|
||||||
|
or (item.channel in ['videolibrary'] and parent_item.action in ['list_tvshows']):
|
||||||
|
mode('tvshow', 'tvshow')
|
||||||
|
|
||||||
|
elif parent_item.action in ['get_seasons']:
|
||||||
|
mode('season', 'tvshow')
|
||||||
|
|
||||||
|
elif parent_item.action in ['episodios', 'get_episodes']:
|
||||||
|
mode('episode', 'tvshow')
|
||||||
|
|
||||||
|
elif parent_item.action == 'findvideos':
|
||||||
|
mode('server', 'addons')
|
||||||
|
|
||||||
|
elif parent_item.action == 'mainlist':
|
||||||
|
mode('channel', 'addons')
|
||||||
|
|
||||||
|
else:
|
||||||
|
mode('addon', 'addons')
|
||||||
|
|
||||||
# logger.info('Content: ' + content + ' - Action: ' + parent_item.action)
|
|
||||||
# xbmcplugin.setContent(handle=int(sys.argv[1]), content=content)
|
|
||||||
# xbmc.executebuiltin('Container.SetViewMode(%s)')
|
|
||||||
|
|
||||||
def render_items_old(itemlist, parent_item):
|
def render_items_old(itemlist, parent_item):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -803,22 +803,23 @@ def update_db(current_path, new_path, current_movies_folder, new_movies_folder,
|
|||||||
path = path.replace(old,new)
|
path = path.replace(old,new)
|
||||||
if sep == '/': path = path.replace('\\','/')
|
if sep == '/': path = path.replace('\\','/')
|
||||||
else: path = path.replace('/','\\')
|
else: path = path.replace('/','\\')
|
||||||
|
if path.endswith(sep + sep): path = path[:-1]
|
||||||
|
|
||||||
return path
|
return path
|
||||||
|
|
||||||
logger.info()
|
logger.info()
|
||||||
|
|
||||||
new = new_path
|
# new = new_path
|
||||||
old = current_path
|
old = current_path
|
||||||
|
|
||||||
# rename main path for search in the DB
|
# rename main path for search in the DB
|
||||||
if new.startswith("special://") or scrapertools.find_single_match(new, r'(^\w+:\/\/)'):
|
# if new.startswith("special://") or scrapertools.find_single_match(new, r'(^\w+:\/\/)'):
|
||||||
new = new.replace('/profile/', '/%/').replace('/home/userdata/', '/%/')
|
# new = new.replace('/profile/', '/%/').replace('/home/userdata/', '/%/')
|
||||||
sep = '/'
|
# sep = '/'
|
||||||
else:
|
# else:
|
||||||
sep = os.sep
|
# sep = os.sep
|
||||||
if not new.endswith(sep):
|
# if not new.endswith(sep):
|
||||||
new += sep
|
# new += sep
|
||||||
|
|
||||||
if old.startswith("special://") or scrapertools.find_single_match(old, r'(^\w+:\/\/)'):
|
if old.startswith("special://") or scrapertools.find_single_match(old, r'(^\w+:\/\/)'):
|
||||||
old = old.replace('/profile/', '/%/').replace('/home/userdata/', '/%/')
|
old = old.replace('/profile/', '/%/').replace('/home/userdata/', '/%/')
|
||||||
|
|||||||
@@ -0,0 +1,81 @@
|
|||||||
|
{
|
||||||
|
"all":{
|
||||||
|
"List": 50,
|
||||||
|
"MediaInfo": 501,
|
||||||
|
"MediaInfo 2": 502,
|
||||||
|
"Tri-Panel": 504,
|
||||||
|
"Banner List": 503,
|
||||||
|
"Poster Wall": 51,
|
||||||
|
"Landscape Wall": 511,
|
||||||
|
"Info Wall": 514,
|
||||||
|
"Info Wall 2": 516,
|
||||||
|
"Landscape Wall Small": 515,
|
||||||
|
"Poster Showcase": 52,
|
||||||
|
"Landscape Showcase": 521,
|
||||||
|
"Poster": 53,
|
||||||
|
"Lovefilm": 523,
|
||||||
|
"Seasons Info": 522,
|
||||||
|
"Seasons Info 2": 524,
|
||||||
|
"Square Wall": 510,
|
||||||
|
"Icon Wall": 512
|
||||||
|
},
|
||||||
|
"movie":{
|
||||||
|
"List": 50,
|
||||||
|
"MediaInfo": 501,
|
||||||
|
"MediaInfo 2": 502,
|
||||||
|
"Tri-Panel": 504,
|
||||||
|
"Banner List": 503,
|
||||||
|
"Poster Wall": 51,
|
||||||
|
"Landscape Wall": 511,
|
||||||
|
"Info Wall": 514,
|
||||||
|
"Info Wall 2": 516,
|
||||||
|
"Landscape Wall Small": 515,
|
||||||
|
"Poster Showcase": 52,
|
||||||
|
"Landscape Showcase": 521,
|
||||||
|
"Poster": 53,
|
||||||
|
"Lovefilm": 523
|
||||||
|
},
|
||||||
|
"tvshow":{
|
||||||
|
"List": 50,
|
||||||
|
"MediaInfo": 501,
|
||||||
|
"MediaInfo 2": 502,
|
||||||
|
"Tri-Panel": 504,
|
||||||
|
"Banner List": 503,
|
||||||
|
"Poster Wall": 51,
|
||||||
|
"Landscape Wall": 511,
|
||||||
|
"Info Wall": 514,
|
||||||
|
"Info Wall 2": 516,
|
||||||
|
"Landscape Wall Small": 515,
|
||||||
|
"Poster Showcase": 52,
|
||||||
|
"Landscape Showcase": 521,
|
||||||
|
"Poster": 53,
|
||||||
|
"Lovefilm": 523
|
||||||
|
},
|
||||||
|
"season":{
|
||||||
|
"List": 50,
|
||||||
|
"Banner List": 503,
|
||||||
|
"Poster Wall": 51,
|
||||||
|
"Info Wall": 514,
|
||||||
|
"Info Wall 2": 516,
|
||||||
|
"Poster Showcase": 52,
|
||||||
|
"Seasons Info": 522,
|
||||||
|
"Seasons Info 2": 524,
|
||||||
|
"Poster": 53
|
||||||
|
},
|
||||||
|
"episode":{
|
||||||
|
"List": 50,
|
||||||
|
"MediaInfo": 501,
|
||||||
|
"MediaInfo 2": 502,
|
||||||
|
"Tri-Panel": 504,
|
||||||
|
"Banner List": 503,
|
||||||
|
"Landscape Wall": 511,
|
||||||
|
"Info Wall 2": 516,
|
||||||
|
"Landscape Wall Small": 515,
|
||||||
|
"Landscape Showcase": 521
|
||||||
|
},
|
||||||
|
"addon":{
|
||||||
|
"List": 50,
|
||||||
|
"Square Wall": 510,
|
||||||
|
"Icon Wall": 512
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
{
|
||||||
|
"all":{
|
||||||
|
"List": 50,
|
||||||
|
"Poster Wall": 51,
|
||||||
|
"Landscape Wall": 52,
|
||||||
|
"Square Wall": 53,
|
||||||
|
"Banner Wall": 54,
|
||||||
|
"Showcase": 55,
|
||||||
|
"Landscape Showcase": 56,
|
||||||
|
"Square Showcase": 57,
|
||||||
|
"Big Posters": 58,
|
||||||
|
"Lovefilm": 59,
|
||||||
|
"Media Info": 500,
|
||||||
|
"info List": 501,
|
||||||
|
"Episode List": 502,
|
||||||
|
"Square Wall Large": 503
|
||||||
|
},
|
||||||
|
"movie":{
|
||||||
|
"List": 50,
|
||||||
|
"Poster Wall": 51,
|
||||||
|
"Landscape Wall": 52,
|
||||||
|
"Showcase": 55,
|
||||||
|
"Landscape Showcase": 56,
|
||||||
|
"Square Showcase": 57,
|
||||||
|
"Big Posters": 58,
|
||||||
|
"Lovefilm": 59,
|
||||||
|
"Media Info": 500,
|
||||||
|
"info List": 501,
|
||||||
|
"Episode List": 502
|
||||||
|
},
|
||||||
|
"tvshow":{
|
||||||
|
"List": 50,
|
||||||
|
"Poster Wall": 51,
|
||||||
|
"Landscape Wall": 52,
|
||||||
|
"Banner Wall": 54,
|
||||||
|
"Showcase": 55,
|
||||||
|
"Landscape Showcase": 56,
|
||||||
|
"Square Showcase": 57,
|
||||||
|
"Big Posters": 58,
|
||||||
|
"Lovefilm": 59,
|
||||||
|
"Media Info": 500,
|
||||||
|
"info List": 501,
|
||||||
|
"Episode List": 502
|
||||||
|
},
|
||||||
|
"season":{
|
||||||
|
"List": 50,
|
||||||
|
"Poster Wall": 51,
|
||||||
|
"Landscape Wall": 52,
|
||||||
|
"Banner Wall": 54,
|
||||||
|
"Showcase": 55,
|
||||||
|
"Landscape Showcase": 56,
|
||||||
|
"Square Showcase": 57,
|
||||||
|
"Big Posters": 58,
|
||||||
|
"Lovefilm": 59,
|
||||||
|
"Media Info": 500,
|
||||||
|
"info List": 501,
|
||||||
|
"Episode List": 502
|
||||||
|
},
|
||||||
|
"episode":{
|
||||||
|
"List": 50,
|
||||||
|
"Poster Wall": 51,
|
||||||
|
"Landscape Wall": 52,
|
||||||
|
"Banner Wall": 54,
|
||||||
|
"Showcase": 55,
|
||||||
|
"Landscape Showcase": 56,
|
||||||
|
"Square Showcase": 57,
|
||||||
|
"Big Posters": 58,
|
||||||
|
"Lovefilm": 59,
|
||||||
|
"Media Info": 500,
|
||||||
|
"info List": 501,
|
||||||
|
"Episode List": 502
|
||||||
|
},
|
||||||
|
"addon":{
|
||||||
|
"List": 50,
|
||||||
|
"Square Wall": 53,
|
||||||
|
"Square Wall Large": 503
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
{
|
||||||
|
"all":{
|
||||||
|
"List": 50,
|
||||||
|
"Poster": 51,
|
||||||
|
"Shift": 53,
|
||||||
|
"InfoWall": 54,
|
||||||
|
"WideList": 55,
|
||||||
|
"Wall": 500,
|
||||||
|
"Banner": 501,
|
||||||
|
"Fanart": 502
|
||||||
|
},
|
||||||
|
"movie":{
|
||||||
|
"List": 50,
|
||||||
|
"Poster": 51,
|
||||||
|
"Shift": 53,
|
||||||
|
"InfoWall": 54,
|
||||||
|
"WideList": 55,
|
||||||
|
"Wall": 500,
|
||||||
|
"Fanart": 502
|
||||||
|
},
|
||||||
|
"tvshow":{
|
||||||
|
"List": 50,
|
||||||
|
"Poster": 51,
|
||||||
|
"Shift": 53,
|
||||||
|
"InfoWall": 54,
|
||||||
|
"WideList": 55,
|
||||||
|
"Wall": 500,
|
||||||
|
"Banner": 501,
|
||||||
|
"Fanart": 502
|
||||||
|
},
|
||||||
|
"season":{
|
||||||
|
"List": 50,
|
||||||
|
"Poster": 51,
|
||||||
|
"Shift": 53,
|
||||||
|
"InfoWall": 54,
|
||||||
|
"WideList": 55,
|
||||||
|
"Wall": 500,
|
||||||
|
"Fanart": 502
|
||||||
|
},
|
||||||
|
"episode":{
|
||||||
|
"List": 50,
|
||||||
|
"Poster": 51,
|
||||||
|
"Shift": 53,
|
||||||
|
"InfoWall": 54,
|
||||||
|
"WideList": 55,
|
||||||
|
"Wall": 500,
|
||||||
|
"Banner": 501,
|
||||||
|
"Fanart": 502
|
||||||
|
},
|
||||||
|
"addon":{
|
||||||
|
"WideList": 55,
|
||||||
|
"Wall": 500
|
||||||
|
}
|
||||||
|
}
|
||||||
+19
-63
@@ -32,73 +32,29 @@ def settings_menu(item):
|
|||||||
def view_mode(item):
|
def view_mode(item):
|
||||||
logger.info(str(item))
|
logger.info(str(item))
|
||||||
import xbmc
|
import xbmc
|
||||||
|
from core import filetools, jsontools, support
|
||||||
from platformcode import config, platformtools
|
from platformcode import config, platformtools
|
||||||
skin_view_mode ={
|
|
||||||
'skin.estuary':{
|
|
||||||
'movie':{
|
|
||||||
'List': 50,
|
|
||||||
'Poster': 51,
|
|
||||||
# 'IconWall': 52,
|
|
||||||
'Shift': 53,
|
|
||||||
'InfoWall': 54,
|
|
||||||
'WideList': 55,
|
|
||||||
'Wall': 500,
|
|
||||||
# 'Banner': 501,
|
|
||||||
'Fanart': 502
|
|
||||||
},
|
|
||||||
'tvshow':{
|
|
||||||
'List': 50,
|
|
||||||
'Poster': 51,
|
|
||||||
'Shift': 53,
|
|
||||||
'InfoWall': 54,
|
|
||||||
'WideList': 55,
|
|
||||||
'Wall': 500,
|
|
||||||
'Banner': 501,
|
|
||||||
'Fanart': 502
|
|
||||||
},
|
|
||||||
'season':{
|
|
||||||
'List': 50,
|
|
||||||
'Poster': 51,
|
|
||||||
'Shift': 53,
|
|
||||||
'InfoWall': 54,
|
|
||||||
'WideList': 55,
|
|
||||||
'Wall': 500,
|
|
||||||
'Fanart': 502
|
|
||||||
},
|
|
||||||
'episode':{
|
|
||||||
'List': 50,
|
|
||||||
'Poster': 51,
|
|
||||||
'Shift': 53,
|
|
||||||
'InfoWall': 54,
|
|
||||||
'WideList': 55,
|
|
||||||
'Wall': 500,
|
|
||||||
'Banner': 501,
|
|
||||||
'Fanart': 502
|
|
||||||
},
|
|
||||||
'server':{
|
|
||||||
'WideList': 55,
|
|
||||||
'Wall': 500
|
|
||||||
},
|
|
||||||
'addon':{
|
|
||||||
'WideList': 55,
|
|
||||||
'Wall': 500
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
list_type = [config.get_localized_string(59992)]
|
skin_name = xbmc.getSkinDir()
|
||||||
skin=xbmc.getSkinDir()
|
config.set_setting('skin_name', skin_name)
|
||||||
skin = skin_view_mode[xbmc.getSkinDir()][item.type]
|
|
||||||
|
|
||||||
for key in skin:
|
path = filetools.join(config.get_runtime_path(), 'resources', 'views', skin_name + '.json')
|
||||||
list_type.append(key)
|
if filetools.isfile(path):
|
||||||
|
json_file = open(path, "r").read()
|
||||||
|
json = jsontools.load(json_file)
|
||||||
|
|
||||||
select = platformtools.dialog_select(config.get_localized_string(60552), list_type)
|
Type = 'addon'if item.type in ['channel', 'server'] else item.type
|
||||||
if select > 0:
|
skin = json[Type]
|
||||||
value = skin[list_type[select]]
|
|
||||||
else:
|
list_type = []
|
||||||
value = 0
|
for key in skin:
|
||||||
config.set_setting('view_mode_%s' % item.type, value)
|
list_type.append(key)
|
||||||
|
list_type.sort()
|
||||||
|
list_type.insert(0, config.get_localized_string(70003))
|
||||||
|
|
||||||
|
select = platformtools.dialog_select(config.get_localized_string(70754), list_type)
|
||||||
|
value = list_type[select] + ' , ' + str(skin[list_type[select]] if list_type[select] in skin else 0)
|
||||||
|
config.set_setting('view_mode_%s' % item.type, value)
|
||||||
|
|
||||||
def servers_menu(item):
|
def servers_menu(item):
|
||||||
# from core.support import dbg; dbg()
|
# from core.support import dbg; dbg()
|
||||||
|
|||||||
Reference in New Issue
Block a user