From a21554f6d17a8e734cbd9b8c50d6e45690dd82d5 Mon Sep 17 00:00:00 2001 From: axlt2002 Date: Sun, 10 May 2020 22:28:13 +0200 Subject: [PATCH 1/2] Editorial in settings.xml e strings.po --- resources/language/English/strings.po | 18 +++++++------- resources/language/Italian/strings.po | 36 +++++++++++++-------------- resources/settings.xml | 12 ++++----- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/resources/language/English/strings.po b/resources/language/English/strings.po index fc3915ed..86d926f4 100644 --- a/resources/language/English/strings.po +++ b/resources/language/English/strings.po @@ -76,7 +76,7 @@ msgid "Password" msgstr "" msgctxt "#30017" -msgid "Download path*" +msgid "Download path" msgstr "" msgctxt "#30018" @@ -204,7 +204,7 @@ msgid "Unsopported Server" msgstr "" msgctxt "#30067" -msgid "Path*" +msgid "Path" msgstr "" msgctxt "#30068" @@ -3269,15 +3269,15 @@ msgid "Confirm new password" msgstr "" msgctxt "#70118" -msgid "TV shows folder*" +msgid "TV shows folder" msgstr "" msgctxt "#70119" -msgid "Movies folder*" +msgid "Movies folder" msgstr "" msgctxt "#70120" -msgid "Add KoD contents to Kodi video library*" +msgid "Add KoD contents to Kodi video library" msgstr "" msgctxt "#70121" @@ -6217,7 +6217,7 @@ msgid "Folder name for TV shows" msgstr "" msgctxt "#80022" -msgid "You can configure the Kodi video library later from the settings menu inside KoD" +msgid "You can configure the Kodi video library later from the KoD settings" msgstr "" msgctxt "#80023" @@ -6225,7 +6225,7 @@ msgid "You will be asked to choose and configure the information providers for m msgstr "" msgctxt "#80024" -msgid "An error has occurred during the configuration of the Kodi video library. Please check the log and try again from the settings menu inside KoD" +msgid "An error has occurred during the configuration of the Kodi video library. Please check the log and try again from the KoD settings" msgstr "" msgctxt "#80025" @@ -6245,7 +6245,7 @@ msgid "The selected folders are already used by the Kodi library. Please change msgstr "" msgctxt "#80029" -msgid "The selected folders are already used by the Kodi library. Please change them properly from the settings menu inside KoD" +msgid "The selected folders are already used by the Kodi library. Please change them properly from the KoD settings" msgstr "" msgctxt "#80030" @@ -6301,7 +6301,7 @@ msgid "Include local episodes when adding a TV shows" msgstr "" msgctxt "#80043" -msgid "Attention, in order to watch local episodes you have to configure the Kodi video library from the settings menu inside KoD" +msgid "Attention, in order to watch local episodes you have to configure the Kodi video library from the KoD settings" msgstr "" msgctxt "#80044" diff --git a/resources/language/Italian/strings.po b/resources/language/Italian/strings.po index af2d7bd4..aa0753bd 100644 --- a/resources/language/Italian/strings.po +++ b/resources/language/Italian/strings.po @@ -76,8 +76,8 @@ msgid "Password" msgstr "Password" msgctxt "#30017" -msgid "Download path*" -msgstr "Percorso download*" +msgid "Download path" +msgstr "Percorso download" msgctxt "#30018" msgid "Download list path" @@ -204,8 +204,8 @@ msgid "Unsopported Server" msgstr "Server non supportato" msgctxt "#30067" -msgid "Path*" -msgstr "Percorso*" +msgid "Path" +msgstr "Percorso" msgctxt "#30068" msgid "Filter by servers" @@ -3268,16 +3268,16 @@ msgid "Confirm new password" msgstr "Conferma nuova password" msgctxt "#70118" -msgid "TV shows folder*" -msgstr "Cartella serie TV*" +msgid "TV shows folder" +msgstr "Cartella serie TV" msgctxt "#70119" -msgid "Movies folder*" -msgstr "Cartella film*" +msgid "Movies folder" +msgstr "Cartella film" msgctxt "#70120" -msgid "Add KoD contents to Kodi video library*" -msgstr "Aggiungi la videoteca di KoD alla libreria di Kodi*" +msgid "Add KoD contents to Kodi video library" +msgstr "Aggiungi la videoteca di KoD alla libreria di Kodi" msgctxt "#70121" msgid "Activate" @@ -6217,16 +6217,16 @@ msgid "Folder name for TV shows" msgstr "Nome della cartella per le serie TV" msgctxt "#80022" -msgid "You can configure the Kodi video library later from the settings menu inside KoD" -msgstr "Potrai configurare la libreria di Kodi in seguito dal menu impostazioni all'interno di KoD" +msgid "You can configure the Kodi video library later from the KoD settings" +msgstr "Potrai configurare la libreria di Kodi in seguito dalle impostazioni di KoD" msgctxt "#80023" msgid "You will be asked to choose and configure the information providers for movies and TV shows" msgstr "Ti verrà chiesto di scegliere e configurare i provider delle informazioni per film e serie TV" msgctxt "#80024" -msgid "An error has occurred during the configuration of the Kodi video library. Please check the log and try again from the settings menu inside KoD" -msgstr "Si è verificato un errore durante la configurazione della libreria di Kodi. Si prega di controllare il log e riprovare dal menu impostazioni all'interno di KoD" +msgid "An error has occurred during the configuration of the Kodi video library. Please check the log and try again from the KoD settings" +msgstr "Si è verificato un errore durante la configurazione della libreria di Kodi. Si prega di controllare il log e riprovare dalle impostazioni di KoD" msgctxt "#80025" msgid "Cleaning database..." @@ -6245,8 +6245,8 @@ msgid "The selected folders are already used by the Kodi library. Please change msgstr "Le cartelle selezionate sono già utilizzate dalla libreria di Kodi. Si prega di cambiarle opportunamente" msgctxt "#80029" -msgid "The selected folders are already used by the Kodi library. Please change them properly from the settings menu inside KoD" -msgstr "Le cartelle selezionate sono già utilizzate dalla libreria di Kodi. Si prega di cambiarle opportunamente dal menu impostazioni all'interno di KoD" +msgid "The selected folders are already used by the Kodi library. Please change them properly from the KoD settings" +msgstr "Le cartelle selezionate sono già utilizzate dalla libreria di Kodi. Si prega di cambiarle opportunamente dalle impostazioni di KoD" msgctxt "#80030" msgid "The default path and folders will be used. You will be asked to choose and configure the information providers for movies and TV shows" @@ -6301,8 +6301,8 @@ msgid "Include local episodes when adding a TV shows" msgstr "Includere episodi in locale all'aggiunta di una serie TV" msgctxt "#80043" -msgid "Attention, in order to watch local episodes you have to configure the Kodi video library from the settings menu inside KoD" -msgstr "Attenzione, per guardare gli episodi in locale devi configurare la libreria di Kodi dal menu impostazioni all'interno di KoD" +msgid "Attention, in order to watch local episodes you have to configure the Kodi video library from the KoD settings" +msgstr "Attenzione, per guardare gli episodi in locale devi configurare la libreria di Kodi dalle impostazioni di KoD" msgctxt "#80044" msgid "Do you want to include local episodes for the TV show "%s"?" diff --git a/resources/settings.xml b/resources/settings.xml index bb6b3820..086a78f9 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -96,12 +96,12 @@ - - - - - - + + + + + + From 4c9430c377574ddbb3fc85737a0e3a0608f8e405 Mon Sep 17 00:00:00 2001 From: axlt2002 Date: Mon, 11 May 2020 00:36:22 +0200 Subject: [PATCH 2/2] Fix episodi locali --- core/videolibrarytools.py | 28 +++++++++++++++++++--------- specials/videolibrary.py | 2 +- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/core/videolibrarytools.py b/core/videolibrarytools.py index d32083c2..006f631b 100644 --- a/core/videolibrarytools.py +++ b/core/videolibrarytools.py @@ -854,11 +854,13 @@ def save_episodes(path, episodelist, serie, silent=False, overwrite=True): return insertados, sobreescritos, fallidos -def config_local_episodes_path(path, title): +def config_local_episodes_path(path, title, silent=False): logger.info() local_episodes_path = '' - if platformtools.dialog_yesno(config.get_localized_string(30131), config.get_localized_string(80044) % title): + if not silent: + silent = platformtools.dialog_yesno(config.get_localized_string(30131), config.get_localized_string(80044) % title) + if silent: if config.is_xbmc() and not config.get_setting("videolibrary_kodi"): platformtools.dialog_ok(config.get_localized_string(30131), config.get_localized_string(80043)) local_episodes_path = platformtools.dialog_browse(0, config.get_localized_string(80046)) @@ -872,9 +874,10 @@ def config_local_episodes_path(path, title): if local_episodes_path: # import artwork + artwork_extensions = ['.jpg', '.jpeg', '.png'] files = filetools.listdir(local_episodes_path) for file in files: - if file.endswith('.jpg') or file.endswith('.jpeg') or file.endswith('.png'): + if os.path.splitext(file)[1] in artwork_extensions: filetools.copy(filetools.join(local_episodes_path, file), filetools.join(path, file)) return 0, local_episodes_path @@ -883,22 +886,29 @@ def config_local_episodes_path(path, title): def process_local_episodes(local_episodes_path, path): logger.info() + sub_extensions = ['.srt', '.sub', '.sbv', '.ass', '.idx', '.ssa', '.smi'] + artwork_extensions = ['.jpg', '.jpeg', '.png'] + extensions = sub_extensions + artwork_extensions + local_episodes_list = [] + files_list = [] for root, folders, files in filetools.walk(local_episodes_path): for file in files: + if os.path.splitext(file)[1] in extensions: + continue season_episode = scrapertools.get_season_and_episode(file) if season_episode == "": continue local_episodes_list.append(season_episode) + files_list.append(file) - local_episodes_list = sorted(set(local_episodes_list)) - nfo_path = filetools.join(path, "tvshow.nfo") head_nfo, item_nfo = read_nfo(nfo_path) # if a local episode has been added, overwrites the strm - for season_episode in set(local_episodes_list).difference(item_nfo.local_episodes_list): - filetools.write(filetools.join(path, season_episode + '.strm'), filetools.join(root, file)) + for season_episode, file in zip(local_episodes_list, files_list): + if not season_episode in item_nfo.local_episodes_list: + filetools.write(filetools.join(path, season_episode + '.strm'), filetools.join(root, file)) # if a local episode has been removed, deletes the strm for season_episode in set(item_nfo.local_episodes_list).difference(local_episodes_list): @@ -907,8 +917,8 @@ def process_local_episodes(local_episodes_path, path): # updates the local episodes path and list in the nfo if not local_episodes_list: item_nfo.local_episodes_path = '' - item_nfo.local_episodes_list = local_episodes_list - + item_nfo.local_episodes_list = sorted(set(local_episodes_list)) + filetools.write(nfo_path, head_nfo + item_nfo.tojson()) diff --git a/specials/videolibrary.py b/specials/videolibrary.py index 0a284182..2e56cf85 100644 --- a/specials/videolibrary.py +++ b/specials/videolibrary.py @@ -822,7 +822,7 @@ def update_tvshow(item): def add_local_episodes(item): logger.info() - done, local_episodes_path = videolibrarytools.config_local_episodes_path(item.path, item.contentSerieName) + done, local_episodes_path = videolibrarytools.config_local_episodes_path(item.path, item.contentSerieName, silent=True) if done < 0: logger.info("An issue has occurred while configuring local episodes") elif local_episodes_path: