- Fix aggiunta episodi presenti in Libreria

- fix Nomi episodi in ricerca globale
This commit is contained in:
Alhaziel01
2021-06-10 16:57:12 +02:00
parent 4b1cb8f9a8
commit 3fd09dbb11
2 changed files with 9 additions and 4 deletions

View File

@@ -632,9 +632,10 @@ def save_episodes(item, episodelist, extra_info, host, local_files, silent=False
# add strm_file if episode is not present in db or inside videolibrary path
# if not filetools.exists(filetools.join(TVSHOWS_PATH, strm_path)):
logger.debug("Creating .strm: " + strm_path)
item_strm = Item(channel='videolibrary', action='play_from_library', strm_path=strm_path, contentType='episode', videolibrary_id=episode_item.videolibrary_id, contentSeason = episode_item.contentSeason, contentEpisodeNumber = episode_item.contentEpisodeNumber,)
filetools.write(filetools.join(TVSHOWS_PATH, strm_path), '{}?{}'.format(addon_name, item_strm.tourl()))
if season_episode not in local_files.get('db',{}).keys():
logger.debug("Creating .strm: " + strm_path)
item_strm = Item(channel='videolibrary', action='play_from_library', strm_path=strm_path, contentType='episode', videolibrary_id=episode_item.videolibrary_id, contentSeason = episode_item.contentSeason, contentEpisodeNumber = episode_item.contentEpisodeNumber,)
filetools.write(filetools.join(TVSHOWS_PATH, strm_path), '{}?{}'.format(addon_name, item_strm.tourl()))
# update db if episode added
if failed == 0 and config.get_setting('kod_scraper'):

View File

@@ -720,7 +720,11 @@ class SearchWindow(xbmcgui.WindowXML):
self.itemsResult = []
ep = []
for item in self.episodes:
it = xbmcgui.ListItem(item.title)
title = item.title
if item.contentEpisodeNumber: title = '{:02d}. {}'.format(item.contentEpisodeNumber, title)
if item.contentSeason: title = '{}x{}'.format(item.contentSeason, title)
it = xbmcgui.ListItem(title)
it.setProperty('item', item.tourl())
ep.append(it)