From 3fd09dbb11647449ef95acba54fbec6586a68c0c Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Thu, 10 Jun 2021 16:57:12 +0200 Subject: [PATCH] - Fix aggiunta episodi presenti in Libreria - fix Nomi episodi in ricerca globale --- core/videolibrarytools.py | 7 ++++--- specials/globalsearch.py | 6 +++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/core/videolibrarytools.py b/core/videolibrarytools.py index 093957c5..b44c311f 100644 --- a/core/videolibrarytools.py +++ b/core/videolibrarytools.py @@ -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'): diff --git a/specials/globalsearch.py b/specials/globalsearch.py index 41f6434b..3aa5eb15 100644 --- a/specials/globalsearch.py +++ b/specials/globalsearch.py @@ -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)