- Fix Aggiunta in Videoteca se episodi in Libreria
- Fix Aggiungi Episodi Locali da menu contestuale in libreria
This commit is contained in:
@@ -585,15 +585,17 @@ def save_episodes(path, episodelist, serie, silent=False, overwrite=True):
|
|||||||
|
|
||||||
# process local episodes
|
# process local episodes
|
||||||
local_episodes_path = ''
|
local_episodes_path = ''
|
||||||
local_episodelist = []
|
|
||||||
update = False
|
update = False
|
||||||
nfo_path = filetools.join(path, "tvshow.nfo")
|
nfo_path = filetools.join(path, "tvshow.nfo")
|
||||||
head_nfo, item_nfo = read_nfo(nfo_path)
|
head_nfo, item_nfo = read_nfo(nfo_path)
|
||||||
|
local_episodelist = item_nfo.local_episodes_list if item_nfo.local_episodes_list else []
|
||||||
|
|
||||||
if config.get_setting('videolibrary_kodi'):
|
if config.get_setting('videolibrary_kodi'):
|
||||||
from platformcode.xbmc_videolibrary import check_db
|
from platformcode.xbmc_videolibrary import check_db
|
||||||
for p in check_db(item_nfo.infoLabels['code']):
|
for p in check_db(item_nfo.infoLabels['code']):
|
||||||
local_episodelist += get_local_content(p)
|
local_episodelist += get_local_content(p)
|
||||||
|
item_nfo.local_episodes_list = local_episodelist
|
||||||
|
filetools.write(nfo_path, head_nfo + item_nfo.tojson())
|
||||||
|
|
||||||
if item_nfo.update_last:
|
if item_nfo.update_last:
|
||||||
local_episodes_path = item_nfo.local_episodes_path
|
local_episodes_path = item_nfo.local_episodes_path
|
||||||
@@ -606,7 +608,7 @@ def save_episodes(path, episodelist, serie, silent=False, overwrite=True):
|
|||||||
filetools.write(nfo_path, head_nfo + item_nfo.tojson())
|
filetools.write(nfo_path, head_nfo + item_nfo.tojson())
|
||||||
|
|
||||||
if local_episodes_path:
|
if local_episodes_path:
|
||||||
process_local_episodes(local_episodes_path, path)
|
process_local_episodes(local_episodes_path, path, local_episodelist)
|
||||||
|
|
||||||
insertados = 0
|
insertados = 0
|
||||||
sobreescritos = 0
|
sobreescritos = 0
|
||||||
@@ -895,24 +897,22 @@ def config_local_episodes_path(path, item, silent=False):
|
|||||||
return 0, local_episodes_path
|
return 0, local_episodes_path
|
||||||
|
|
||||||
|
|
||||||
def process_local_episodes(local_episodes_path, path):
|
def process_local_episodes(local_episodes_path, path, local_episodes_list):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
|
|
||||||
sub_extensions = ['.srt', '.sub', '.sbv', '.ass', '.idx', '.ssa', '.smi']
|
sub_extensions = ['.srt', '.sub', '.sbv', '.ass', '.idx', '.ssa', '.smi']
|
||||||
artwork_extensions = ['.jpg', '.jpeg', '.png']
|
artwork_extensions = ['.jpg', '.jpeg', '.png']
|
||||||
extensions = sub_extensions + artwork_extensions
|
extensions = sub_extensions + artwork_extensions
|
||||||
|
|
||||||
local_episodes_list = []
|
|
||||||
files_list = []
|
files_list = []
|
||||||
for root, folders, files in filetools.walk(local_episodes_path):
|
for root, folders, files in filetools.walk(local_episodes_path):
|
||||||
for file in files:
|
for file in files:
|
||||||
if os.path.splitext(file)[1] in extensions:
|
if os.path.splitext(file)[1] in extensions:
|
||||||
continue
|
continue
|
||||||
season_episode = scrapertools.get_season_and_episode(file)
|
season_episode = scrapertools.get_season_and_episode(file)
|
||||||
if season_episode == "":
|
if season_episode and season_episode not in local_episodes_list:
|
||||||
continue
|
local_episodes_list.append(season_episode)
|
||||||
local_episodes_list.append(season_episode)
|
files_list.append(file)
|
||||||
files_list.append(file)
|
|
||||||
|
|
||||||
nfo_path = filetools.join(path, "tvshow.nfo")
|
nfo_path = filetools.join(path, "tvshow.nfo")
|
||||||
head_nfo, item_nfo = read_nfo(nfo_path)
|
head_nfo, item_nfo = read_nfo(nfo_path)
|
||||||
|
|||||||
@@ -145,12 +145,9 @@ def get_menu_items():
|
|||||||
update_text = config.get_localized_string(60023)
|
update_text = config.get_localized_string(60023)
|
||||||
value = 1
|
value = 1
|
||||||
items.append((update_text,
|
items.append((update_text,
|
||||||
lambda: xbmc.executebuiltin("RunPlugin(plugin://plugin.video.kod/?%s&%s)" % (item_url,
|
lambda: xbmc.executebuiltin("RunPlugin(plugin://plugin.video.kod/?{}&title={}&action=mark_tvshow_as_updatable&channel=videolibrary&active={})".format(item_url, update_text, str(value)))))
|
||||||
"title=" + update_text + "&action=mark_tvshow_as_updatable&channel=videolibrary&active=" + str(value)))))
|
|
||||||
if item.local_episodes_path == "":
|
if item.local_episodes_path == "":
|
||||||
items.append((config.get_localized_string(80048),
|
items.append((config.get_localized_string(80048), lambda: xbmc.executebuiltin("RunPlugin(plugin://plugin.video.kod/?{}&action=add_local_episodes&channel=videolibrary&path={})".format(item_url, path))))
|
||||||
lambda: xbmc.executebuiltin("RunPlugin(plugin://plugin.video.kod/?%s&%s)" %
|
|
||||||
(item_url, "action=add_local_episodes&channel=videolibrary"))))
|
|
||||||
|
|
||||||
# if config.get_setting('downloadenabled'):
|
# if config.get_setting('downloadenabled'):
|
||||||
# from core import videolibrarytools
|
# from core import videolibrarytools
|
||||||
|
|||||||
Reference in New Issue
Block a user