viste di default come prima

This commit is contained in:
marco
2020-04-18 22:54:28 +02:00
parent 7f86424ec1
commit dc3d2d4d2a
+15 -14
View File
@@ -38,6 +38,8 @@ from platformcode import logger
from platformcode import config from platformcode import config
from platformcode import unify from platformcode import unify
addon = xbmcaddon.Addon('plugin.video.kod')
addon_icon = os.path.join( addon.getAddonInfo( "path" ), "logo.png" )
class XBMCPlayer(xbmc.Player): class XBMCPlayer(xbmc.Player):
@@ -60,10 +62,10 @@ def dialog_ok(heading, line1, line2="", line3=""):
return dialog.ok(heading, makeMessage(line1, line2, line3)) return dialog.ok(heading, makeMessage(line1, line2, line3))
def dialog_notification(heading, message, icon=0, time=5000, sound=True): def dialog_notification(heading, message, icon=3, time=5000, sound=True):
dialog = xbmcgui.Dialog() dialog = xbmcgui.Dialog()
try: try:
l_icono = xbmcgui.NOTIFICATION_INFO, xbmcgui.NOTIFICATION_WARNING, xbmcgui.NOTIFICATION_ERROR l_icono = xbmcgui.NOTIFICATION_INFO, xbmcgui.NOTIFICATION_WARNING, xbmcgui.NOTIFICATION_ERROR, addon_icon
dialog.notification(heading, message, l_icono[icon], time, sound) dialog.notification(heading, message, l_icono[icon], time, sound)
except: except:
dialog_ok(heading, message) dialog_ok(heading, message)
@@ -232,14 +234,14 @@ def render_items(itemlist, parent_item):
def set_view_mode(item, parent_item): def set_view_mode(item, parent_item):
def mode(content, Type): def mode(content, Type):
mode = int(config.get_setting('view_mode_%s' % content).split(',')[-1]) mode = int(config.get_setting('view_mode_%s' % content).split(',')[-1])
if mode > 0: if mode == 0:
xbmcplugin.setContent(handle=int(sys.argv[1]), content=Type) logger.info('default mode')
xbmc.executebuiltin('Container.SetViewMode(%s)' % mode) mode = 55
logger.info('TYPE: ' + Type) elif not Type:
else: Type = 'addons'
xbmcplugin.setContent(handle=int(sys.argv[1]), content='') xbmcplugin.setContent(handle=int(sys.argv[1]), content=Type)
xbmc.executebuiltin('Container.SetViewMode(%s)' % 55) xbmc.executebuiltin('Container.SetViewMode(%s)' % mode)
logger.info('TYPE: ' + 'None') logger.info('TYPE: ' + Type + ' - ' + 'CONTENT: ' + content)
def reset_view_mode(): def reset_view_mode():
for mode in ['addon','channel','movie','tvshow','season','episode','server']: for mode in ['addon','channel','movie','tvshow','season','episode','server']:
@@ -267,13 +269,13 @@ def set_view_mode(item, parent_item):
mode('episode', 'tvshows') mode('episode', 'tvshows')
elif parent_item.action == 'findvideos': elif parent_item.action == 'findvideos':
mode('server', 'addons') mode('server', '')
elif parent_item.action == 'mainlist': elif parent_item.action == 'mainlist':
mode('channel', 'addons') mode('channel', '')
else: else:
mode('addon', 'addons') mode('addon', '')
def render_items_old(itemlist, parent_item): def render_items_old(itemlist, parent_item):
@@ -1177,7 +1179,6 @@ def set_opcion(item, seleccion, opciones, video_urls):
# "Descargar" # "Descargar"
elif opciones[seleccion] == config.get_localized_string(30153): elif opciones[seleccion] == config.get_localized_string(30153):
from specials import downloads from specials import downloads
downloads.show_disclaimer()
if item.contentType == "list" or item.contentType == "tvshow": if item.contentType == "list" or item.contentType == "tvshow":
item.contentType = "video" item.contentType = "video"