- Riscritto News
- Finzioni peliculas -> movies, episodios -> episodes - Aggiornato sqlitedict - fix minori
This commit is contained in:
@@ -143,7 +143,7 @@ def get_environment():
|
||||
|
||||
try:
|
||||
environment['videolab_series'] = '?'
|
||||
environment['videolab_episodios'] = '?'
|
||||
environment['videolab_episodes'] = '?'
|
||||
environment['videolab_pelis'] = '?'
|
||||
environment['videolab_path'] = str(xbmc.translatePath(config.get_videolibrary_path()))
|
||||
if filetools.exists(filetools.join(environment['videolab_path'], config.get_setting("folder_tvshows"))):
|
||||
@@ -152,7 +152,7 @@ def get_environment():
|
||||
for root, folders, files in filetools.walk(filetools.join(environment['videolab_path'], config.get_setting("folder_tvshows"))):
|
||||
for file in files:
|
||||
if file.endswith('.strm'): counter += 1
|
||||
environment['videolab_episodios'] = str(counter)
|
||||
environment['videolab_episodes'] = str(counter)
|
||||
if filetools.exists(filetools.join(environment['videolab_path'], config.get_setting("folder_movies"))):
|
||||
environment['videolab_pelis'] = str(len(filetools.listdir(filetools.join(environment['videolab_path'], config.get_setting("folder_movies")))))
|
||||
except:
|
||||
@@ -321,7 +321,7 @@ def get_environment():
|
||||
environment['kodi_bmode'] = ''
|
||||
environment['kodi_rfactor'] = ''
|
||||
environment['videolab_series'] = ''
|
||||
environment['videolab_episodios'] = ''
|
||||
environment['videolab_episodes'] = ''
|
||||
environment['videolab_pelis'] = ''
|
||||
environment['videolab_update'] = ''
|
||||
environment['debug'] = ''
|
||||
@@ -366,7 +366,7 @@ def list_env(environment={}):
|
||||
environment['userdata_free'].replace('.', ',') + ' GB')
|
||||
|
||||
logger.info('Videolibrary: Series/Episodes: ' + environment['videolab_series'] + '/' +
|
||||
environment['videolab_episodios'] + ' - Pelis: ' +
|
||||
environment['videolab_episodes'] + ' - Pelis: ' +
|
||||
environment['videolab_pelis'] + ' - Upd: ' +
|
||||
environment['videolab_update'] + ' - Path: ' +
|
||||
environment['videolab_path'] + ' - Free: ' +
|
||||
@@ -520,7 +520,7 @@ def paint_env(item, environment={}):
|
||||
' GB', action="", plot=userdata, thumbnail=thumb, folder=False))
|
||||
|
||||
itemlist.append(Item(channel=item.channel, title='Video store: Series/Epis: ' +
|
||||
environment['videolab_series'] + '/' + environment['videolab_episodios'] +
|
||||
environment['videolab_series'] + '/' + environment['videolab_episodes'] +
|
||||
' - Movie: ' + environment['videolab_pelis'] + ' - Upd: ' + environment['videolab_update'] + ' - Path: ' +
|
||||
environment['videolab_path'] + ' - Free: ' + environment[ 'videolab_free'].replace('.', ',') +
|
||||
' GB', action="", plot=videoteca, thumbnail=thumb, folder=False))
|
||||
|
||||
@@ -461,10 +461,10 @@ def render_items(itemlist, parent_item):
|
||||
breadcrumb = config.get_localized_string(70693)
|
||||
|
||||
xbmcplugin.setPluginCategory(handle=_handle, category=breadcrumb)
|
||||
|
||||
set_view_mode(itemlist[0], parent_item)
|
||||
|
||||
xbmcplugin.endOfDirectory(_handle)
|
||||
xbmcplugin.endOfDirectory(_handle, succeeded=True, updateListing=False, cacheToDisc=False)
|
||||
|
||||
|
||||
logger.debug('END render_items')
|
||||
|
||||
@@ -489,10 +489,10 @@ def viewmodeMonitor():
|
||||
if currentModeName and 'plugin.video.kod' in xbmc.getInfoLabel('Container.FolderPath') and currentMode < 1000 and currentMode >= 50: # inside addon and in itemlist view
|
||||
content, Type = getCurrentView()
|
||||
if content:
|
||||
defaultMode = int(config.get_setting('view_mode_%s' % content).split(',')[-1])
|
||||
defaultMode = int(config.get_setting('view_mode_{}'.format(content)).split(',')[-1])
|
||||
if currentMode != defaultMode:
|
||||
logger.debug('viewmode changed: ' + currentModeName + '-' + str(currentMode) + ' - content: ' + content)
|
||||
config.set_setting('view_mode_%s' % content, currentModeName + ', ' + str(currentMode))
|
||||
config.set_setting('view_mode_{}'.format(content), currentModeName + ', ' + str(currentMode))
|
||||
dialog_notification(config.get_localized_string(70153),
|
||||
config.get_localized_string(70187) % (content, currentModeName),
|
||||
sound=False)
|
||||
@@ -512,8 +512,8 @@ def getCurrentView(item=None, parent_item=None):
|
||||
if not info:
|
||||
return None, None
|
||||
item = Item().fromurl(info) if info else Item()
|
||||
parent_actions = ['peliculas', 'novedades', 'search', 'get_from_temp', 'newest', 'discover_list', 'new_search', 'channel_search']
|
||||
|
||||
parent_actions = ['movies', 'news', 'search', 'get_from_temp', 'newest', 'discover_list', 'new_search', 'channel_search']
|
||||
logger.debug('PARENT:',parent_item.action)
|
||||
if parent_item.action == 'findvideos' or (parent_item.action in ['channel_search', 'new_search'] and parent_item.infoLabels['tmdb_id']):
|
||||
return 'server', 'addons' if config.get_setting('touch_view') else ''
|
||||
|
||||
@@ -533,32 +533,38 @@ def getCurrentView(item=None, parent_item=None):
|
||||
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':
|
||||
elif parent_item.action in ['episodes', 'get_episodes'] or item.contentType == 'episode':
|
||||
return 'episode', 'episodes'
|
||||
|
||||
elif not parent_item.action or parent_item.action in ['getmainlist']:
|
||||
return 'home', 'addons' if config.get_setting('touch_view') else ''
|
||||
|
||||
elif parent_item.action in ['filterchannels']:
|
||||
return 'channels', 'addons' if config.get_setting('touch_view') else ''
|
||||
|
||||
else:
|
||||
return 'menu', 'addons' if config.get_setting('touch_view') else ''
|
||||
|
||||
|
||||
def set_view_mode(item, parent_item):
|
||||
def reset_view_mode():
|
||||
for mode in ['menu','channel','movie','tvshow','season','episode','server']:
|
||||
for mode in ['menu','channel','channels','home', 'movie','tvshow','season','episode','server']:
|
||||
config.set_setting('skin_name', xbmc.getSkinDir())
|
||||
config.set_setting('view_mode_%s' % mode, config.get_localized_string(70003) + ' , 0')
|
||||
config.set_setting('view_mode_{}'.format(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)
|
||||
xbmc.executebuiltin('Container.SetViewMode({})'.format(55))
|
||||
|
||||
content, Type = getCurrentView(item, parent_item)
|
||||
if content:
|
||||
mode = int(config.get_setting('view_mode_%s' % content).split(',')[-1])
|
||||
mode = int(config.get_setting('view_mode_{}'.format(content)).split(',')[-1])
|
||||
if mode == 0:
|
||||
logger.debug('default mode')
|
||||
mode = 55
|
||||
xbmcplugin.setContent(handle=int(sys.argv[1]), content=Type)
|
||||
xbmc.executebuiltin('Container.SetViewMode(%s)' % mode)
|
||||
xbmc.executebuiltin('Container.SetViewMode({})'.format(mode))
|
||||
logger.debug('TYPE: ' + Type + ' - ' + 'CONTENT: ' + content)
|
||||
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ from platformcode import config, logger
|
||||
from core.item import Item
|
||||
from core import scrapertools
|
||||
|
||||
thumb_dict = {"movies": "https://s10.postimg.cc/fxtqzdog9/peliculas.png",
|
||||
thumb_dict = {"movies": "https://s10.postimg.cc/fxtqzdog9/movies.png",
|
||||
"tvshows": "https://s10.postimg.cc/kxvslawe1/series.png",
|
||||
"on air": "https://i.postimg.cc/HLLJWMcr/en-emision.png",
|
||||
"all": "https://s10.postimg.cc/h1igpgw0p/todas.png",
|
||||
@@ -131,7 +131,7 @@ def set_genre(string):
|
||||
'thriller': ['thriller', 'thrillers'],
|
||||
'western': ['western', 'westerns', 'oeste western']
|
||||
}
|
||||
string = re.sub(r'peliculas de |pelicula de la |peli |cine ', '', string)
|
||||
string = re.sub(r'movies de |pelicula de la |peli |cine ', '', string)
|
||||
for genre, variants in list(genres_dict.items()):
|
||||
if string in variants:
|
||||
string = genre
|
||||
|
||||
@@ -196,19 +196,19 @@ def sync_trakt_addon(path_folder):
|
||||
serie.library_playcounts[k] = dict_trakt_show.get(k, 0)
|
||||
|
||||
for season in seasons:
|
||||
episodios_temporada = 0
|
||||
episodios_vistos_temporada = 0
|
||||
episodes_temporada = 0
|
||||
episodes_vistos_temporada = 0
|
||||
|
||||
# we obtain the keys of the episodes of a certain season
|
||||
keys_season_episodes = [key for key in keys_episodes if key.startswith("%sx" % season)]
|
||||
|
||||
for k in keys_season_episodes:
|
||||
episodios_temporada += 1
|
||||
episodes_temporada += 1
|
||||
if serie.library_playcounts[k] > 0:
|
||||
episodios_vistos_temporada += 1
|
||||
episodes_vistos_temporada += 1
|
||||
|
||||
# it is verified that if all the episodes are watched, the season is marked as watched
|
||||
if episodios_temporada == episodios_vistos_temporada:
|
||||
if episodes_temporada == episodes_vistos_temporada:
|
||||
serie.library_playcounts.update({"season %s" % season: 1})
|
||||
|
||||
temporada = 0
|
||||
|
||||
Reference in New Issue
Block a user