Configurazione libreria Kodi rivista

This commit is contained in:
axlt2002
2020-03-29 01:49:31 +01:00
parent f351270c6f
commit b50a704260
11 changed files with 311 additions and 252 deletions
+2 -2
View File
@@ -221,7 +221,7 @@ def save_movie(item):
if filetools.write(nfo_path, head_nfo + item_nfo.tojson()):
#logger.info("FOLDER_MOVIES : %s" % FOLDER_MOVIES)
# actualizamos la videoteca de Kodi con la pelicula
if config.is_xbmc():
if config.is_xbmc() and config.get_setting("videolibrary_kodi"):
from platformcode import xbmc_videolibrary
xbmc_videolibrary.update()
@@ -831,7 +831,7 @@ def save_episodes(path, episodelist, serie, silent=False, overwrite=True):
fallidos = -1
else:
# ... si ha sido correcto actualizamos la videoteca de Kodi
if config.is_xbmc() and not silent:
if config.is_xbmc() and config.get_setting("videolibrary_kodi") and not silent:
from platformcode import xbmc_videolibrary
xbmc_videolibrary.update()
+15 -21
View File
@@ -219,31 +219,25 @@ def open_settings():
set_setting('adult_aux_new_password1', '')
set_setting('adult_aux_new_password2', '')
from specials import move_videolibrary
move_videolibrary.set_new_path(settings_pre.get('downloadpath'), settings_post.get('downloadpath'))
# si se ha puesto que se quiere autoconfigurar y se había creado el directorio de la videoteca
if not settings_pre.get("videolibrary_kodi", None) and settings_post.get("videolibrary_kodi", None) \
and settings_post.get("videolibrary_kodi_flag", None) == 1:
from platformcode import xbmc_videolibrary
xbmc_videolibrary.ask_set_content(2, silent=True)
xbmc.sleep(2000)
xbmc_videolibrary.update(settings_post.get("folder_movies", None))
xbmc_videolibrary.update(settings_post.get("folder_tvshows", None))
elif settings_pre.get("videolibrary_kodi", None) and not settings_post.get("videolibrary_kodi", None) \
and settings_post.get("videolibrary_kodi_flag", None) == 2:
move_videolibrary.clear_videolibrary_db()
if settings_pre.get('downloadpath', None) != settings_post.get('downloadpath', None):
move_videolibrary.update_sources(settings_pre.get('downloadpath', None), settings_post.get('downloadpath', None))
# si se ha cambiado la ruta de la videoteca llamamos a comprobar directorios para que lo cree y pregunte
# automaticamente si configurar la videoteca
"""if settings_pre.get("videolibrarypath", None) != settings_post.get("videolibrarypath", None) or \
settings_pre.get("folder_movies", None) != settings_post.get("folder_movies", None) or \
settings_pre.get("folder_tvshows", None) != settings_post.get("folder_tvshows", None):
verify_directories_created()"""
move_videolibrary.move_videolibrary(settings_pre.get("videolibrarypath", None), settings_post.get("videolibrarypath", None),
settings_pre.get("folder_movies", None), settings_post.get("folder_movies", None),
settings_pre.get("folder_tvshows", None), settings_post.get("folder_tvshows", None))
if settings_pre.get("videolibrarypath", None) != settings_post.get("videolibrarypath", None) or \
settings_pre.get("folder_movies", None) != settings_post.get("folder_movies", None) or \
settings_pre.get("folder_tvshows", None) != settings_post.get("folder_tvshows", None):
move_videolibrary.move_videolibrary(settings_pre.get("videolibrarypath", None), settings_post.get("videolibrarypath", None),
settings_pre.get("folder_movies", None), settings_post.get("folder_movies", None),
settings_pre.get("folder_tvshows", None), settings_post.get("folder_tvshows", None))
# si se ha puesto que se quiere autoconfigurar y se había creado el directorio de la videoteca
if not settings_pre.get("videolibrary_kodi", None) and settings_post.get("videolibrary_kodi", None):
from platformcode import xbmc_videolibrary
xbmc_videolibrary.ask_set_content(silent=True)
elif settings_pre.get("videolibrary_kodi", None) and not settings_post.get("videolibrary_kodi", None):
move_videolibrary.clear_db()
def get_setting(name, channel="", server="", default=None):
+1 -1
View File
@@ -84,7 +84,7 @@ def run(item=None):
item = Item(channel="channelselector", action="getmainlist", viewmode="movie")
if not config.get_setting('show_once'):
from platformcode import xbmc_videolibrary
xbmc_videolibrary.ask_set_content(1, config.get_setting('videolibrary_kodi_force'))
xbmc_videolibrary.ask_set_content(silent=False)
config.set_setting('show_once', True)
logger.info(item.tostring())
+106 -83
View File
@@ -538,26 +538,26 @@ def search_library_path():
return None
def set_content(content_type, silent=False):
def set_content(content_type, silent=False, custom=False):
"""
Procedimiento para auto-configurar la videoteca de kodi con los valores por defecto
@type content_type: str ('movie' o 'tvshow')
@param content_type: tipo de contenido para configurar, series o peliculas
"""
logger.info()
continuar = True
msg_text = ""
videolibrarypath = config.get_setting("videolibrarypath")
forced = config.get_setting('videolibrary_kodi_force')
if content_type == 'movie':
scraper = [config.get_localized_string(70093), config.get_localized_string(70096)]
if forced:
if not custom:
seleccion = 0 # tmdb
else:
seleccion = platformtools.dialog_select(config.get_localized_string(70094), scraper)
# Instalar The Movie Database
# Instalar The Movie Database
if seleccion == -1 or seleccion == 0:
if not xbmc.getCondVisibility('System.HasAddon(metadata.themoviedb.org)'):
if not silent:
@@ -577,7 +577,6 @@ def set_content(content_type, silent=False):
continuar = (install and xbmc.getCondVisibility('System.HasAddon(metadata.themoviedb.org)'))
if not continuar:
msg_text = config.get_localized_string(60047)
if continuar:
xbmc.executebuiltin('xbmc.addon.opensettings(metadata.themoviedb.org)', True)
@@ -607,7 +606,7 @@ def set_content(content_type, silent=False):
else: # SERIES
scraper = [config.get_localized_string(70098), config.get_localized_string(70093)]
if forced:
if not custom:
seleccion = 0 # tvdb
else:
seleccion = platformtools.dialog_select(config.get_localized_string(70107), scraper)
@@ -631,7 +630,7 @@ def set_content(content_type, silent=False):
continuar = (install and xbmc.getCondVisibility('System.HasAddon(metadata.tvdb.com)'))
if not continuar:
msg_text = config.get_localized_string(70099)
msg_text = config.get_localized_string(60049)
if continuar:
xbmc.executebuiltin('xbmc.addon.opensettings(metadata.tvdb.com)', True)
@@ -641,7 +640,7 @@ def set_content(content_type, silent=False):
continuar = False
if not silent:
# Preguntar si queremos instalar metadata.tvshows.themoviedb.org
install = platformtools.dialog_yesno(config.get_localized_string(70100))
install = platformtools.dialog_yesno(config.get_localized_string(60050))
else:
install = True
@@ -656,7 +655,7 @@ def set_content(content_type, silent=False):
continuar = (install and continuar)
if not continuar:
msg_text = config.get_localized_string(60047)
msg_text = config.get_localized_string(60051)
if continuar:
xbmc.executebuiltin('xbmc.addon.opensettings(metadata.tvshows.themoviedb.org)', True)
@@ -719,6 +718,9 @@ def set_content(content_type, silent=False):
elif seleccion == 1:
strScraper = 'metadata.universal'
path_settings = xbmc.translatePath("special://profile/addon_data/metadata.universal/settings.xml")
if not os.path.exists(path_settings):
logger.info("%s: %s" % (content_type, path_settings + " doesn't exist"))
return continuar
settings_data = filetools.read(path_settings)
strSettings = ' '.join(settings_data.split()).replace("> <", "><")
strSettings = strSettings.replace("\"","\'")
@@ -735,6 +737,9 @@ def set_content(content_type, silent=False):
elif seleccion == 1:
strScraper = 'metadata.tvshows.themoviedb.org'
path_settings = xbmc.translatePath("special://profile/addon_data/metadata.tvshows.themoviedb.org/settings.xml")
if not os.path.exists(path_settings):
logger.info("%s: %s" % (content_type, path_settings + " doesn't exist"))
return continuar
settings_data = filetools.read(path_settings)
strSettings = ' '.join(settings_data.split()).replace("> <", "><")
strSettings = strSettings.replace("\"","\'")
@@ -784,9 +789,9 @@ def set_content(content_type, silent=False):
else:
heading = config.get_localized_string(70103) % content_type
msg_text = config.get_localized_string(70104)
platformtools.dialog_notification(heading, msg_text, icon=1, time=3000)
logger.info("%s: %s" % (heading, msg_text))
return continuar
def execute_sql_kodi(sql):
@@ -856,99 +861,117 @@ def execute_sql_kodi(sql):
def add_sources(path):
logger.info()
from xml.dom import minidom
try:
from xml.dom import minidom
SOURCES_PATH = xbmc.translatePath("special://userdata/sources.xml")
SOURCES_PATH = xbmc.translatePath("special://userdata/sources.xml")
if os.path.exists(SOURCES_PATH):
xmldoc = minidom.parse(SOURCES_PATH)
else:
# Crear documento
xmldoc = minidom.Document()
nodo_sources = xmldoc.createElement("sources")
if os.path.exists(SOURCES_PATH):
xmldoc = minidom.parse(SOURCES_PATH)
else:
# Crear documento
xmldoc = minidom.Document()
nodo_sources = xmldoc.createElement("sources")
for type in ['programs', 'video', 'music', 'picture', 'files']:
nodo_type = xmldoc.createElement(type)
element_default = xmldoc.createElement("default")
element_default.setAttribute("pathversion", "1")
nodo_type.appendChild(element_default)
nodo_sources.appendChild(nodo_type)
xmldoc.appendChild(nodo_sources)
for type in ['programs', 'video', 'music', 'picture', 'files']:
nodo_type = xmldoc.createElement(type)
element_default = xmldoc.createElement("default")
element_default.setAttribute("pathversion", "1")
nodo_type.appendChild(element_default)
nodo_sources.appendChild(nodo_type)
xmldoc.appendChild(nodo_sources)
# Buscamos el nodo video
nodo_video = xmldoc.childNodes[0].getElementsByTagName("video")[0]
# Buscamos el nodo video
nodo_video = xmldoc.childNodes[0].getElementsByTagName("video")[0]
# Buscamos el path dentro de los nodos_path incluidos en el nodo_video
nodos_paths = nodo_video.getElementsByTagName("path")
list_path = [p.firstChild.data for p in nodos_paths]
logger.debug(list_path)
if path in list_path:
logger.debug("La ruta %s ya esta en sources.xml" % path)
return
logger.debug("La ruta %s NO esta en sources.xml" % path)
# Buscamos el path dentro de los nodos_path incluidos en el nodo_video
nodos_paths = nodo_video.getElementsByTagName("path")
list_path = [p.firstChild.data for p in nodos_paths]
logger.debug(list_path)
if path in list_path:
logger.debug("La ruta %s ya esta en sources.xml" % path)
return True
logger.debug("La ruta %s NO esta en sources.xml" % path)
# Si llegamos aqui es por q el path no esta en sources.xml, asi q lo incluimos
nodo_source = xmldoc.createElement("source")
# Si llegamos aqui es por q el path no esta en sources.xml, asi q lo incluimos
nodo_source = xmldoc.createElement("source")
# Nodo <name>
nodo_name = xmldoc.createElement("name")
sep = os.sep
if path.startswith("special://") or scrapertools.find_single_match(path, '(^\w+:\/\/)'):
sep = "/"
name = path
if path.endswith(sep):
name = path[:-1]
nodo_name.appendChild(xmldoc.createTextNode(name.rsplit(sep)[-1]))
nodo_source.appendChild(nodo_name)
# Nodo <name>
nodo_name = xmldoc.createElement("name")
sep = os.sep
if path.startswith("special://") or scrapertools.find_single_match(path, '(^\w+:\/\/)'):
sep = "/"
name = path
if path.endswith(sep):
name = path[:-1]
nodo_name.appendChild(xmldoc.createTextNode(name.rsplit(sep)[-1]))
nodo_source.appendChild(nodo_name)
# Nodo <path>
nodo_path = xmldoc.createElement("path")
nodo_path.setAttribute("pathversion", "1")
nodo_path.appendChild(xmldoc.createTextNode(path))
nodo_source.appendChild(nodo_path)
# Nodo <path>
nodo_path = xmldoc.createElement("path")
nodo_path.setAttribute("pathversion", "1")
nodo_path.appendChild(xmldoc.createTextNode(path))
nodo_source.appendChild(nodo_path)
# Nodo <allowsharing>
nodo_allowsharing = xmldoc.createElement("allowsharing")
nodo_allowsharing.appendChild(xmldoc.createTextNode('true'))
nodo_source.appendChild(nodo_allowsharing)
# Nodo <allowsharing>
nodo_allowsharing = xmldoc.createElement("allowsharing")
nodo_allowsharing.appendChild(xmldoc.createTextNode('true'))
nodo_source.appendChild(nodo_allowsharing)
# Añadimos <source> a <video>
nodo_video.appendChild(nodo_source)
# Añadimos <source> a <video>
nodo_video.appendChild(nodo_source)
# Guardamos los cambios
if not PY3:
filetools.write(SOURCES_PATH,
'\n'.join([x for x in xmldoc.toprettyxml().encode("utf-8").splitlines() if x.strip()]))
else:
filetools.write(SOURCES_PATH,
b'\n'.join([x for x in xmldoc.toprettyxml().encode("utf-8").splitlines() if x.strip()]),
vfs=False)
# Guardamos los cambios
if not PY3:
filetools.write(SOURCES_PATH,
'\n'.join([x for x in xmldoc.toprettyxml().encode("utf-8").splitlines() if x.strip()]))
else:
filetools.write(SOURCES_PATH,
b'\n'.join([x for x in xmldoc.toprettyxml().encode("utf-8").splitlines() if x.strip()]),
vfs=False)
logger.debug("The path %s has been added to sources.xml" % path)
return True
except:
logger.debug("An error occurred. The path %s has not been added to sources.xml" % path)
return False
def ask_set_content(flag, silent=False):
def ask_set_content(silent=False):
logger.info()
logger.debug("videolibrary_kodi_flag %s" % config.get_setting("videolibrary_kodi_flag"))
logger.debug("videolibrary_kodi %s" % config.get_setting("videolibrary_kodi"))
def do_config():
logger.debug("hemos aceptado")
config.set_setting("videolibrary_kodi", True)
set_content("movie", silent=True)
set_content("tvshow", silent=True)
add_sources(config.get_setting("videolibrarypath"))
add_sources(config.get_setting("downloadpath"))
def do_config(custom=False):
if set_content("movie", True, custom) and set_content("tvshow", True, custom) and \
add_sources(config.get_setting("videolibrarypath")) and \
add_sources(config.get_setting("downloadpath")):
platformtools.dialog_ok(config.get_localized_string(20000), config.get_localized_string(70104))
config.set_setting("videolibrary_kodi", True)
update()
else:
platformtools.dialog_ok(config.get_localized_string(20000), config.get_localized_string(80024))
config.set_setting("videolibrary_kodi", False)
if not silent:
heading = config.get_localized_string(59971)
linea1 = config.get_localized_string(70105)
linea2 = config.get_localized_string(70106)
if platformtools.dialog_yesno(heading, linea1, linea2):
do_config()
if platformtools.dialog_yesno(config.get_localized_string(20000), config.get_localized_string(80015)):
if not platformtools.dialog_yesno(config.get_localized_string(20000), config.get_localized_string(80016), "", "", config.get_localized_string(80017), config.get_localized_string(80018)):
path = platformtools.dialog_browse(3, config.get_localized_string(80019), config.get_setting("videolibrarypath"))
if path != "":
config.set_setting("videolibrarypath", path)
folder = platformtools.dialog_input(config.get_setting("folder_movies"), config.get_localized_string(80020))
if folder != "":
config.set_setting("folder_movies", folder)
folder = platformtools.dialog_input(config.get_setting("folder_tvshows"), config.get_localized_string(80021))
if folder != "":
config.set_setting("folder_tvshows", folder)
config.verify_directories_created()
do_config(True)
else:
do_config(False)
else:
# no hemos aceptado
platformtools.dialog_ok(config.get_localized_string(20000), config.get_localized_string(80022))
config.set_setting("videolibrary_kodi", False)
else:
do_config()
config.set_setting("videolibrary_kodi_flag", flag)
platformtools.dialog_ok(config.get_localized_string(20000), config.get_localized_string(80023))
do_config(True)
+55 -31
View File
@@ -795,27 +795,27 @@ msgid "Sync with Trakt started"
msgstr ""
msgctxt "#60046"
msgid "TheMovieDB not present.\nInstall it now?"
msgid "The Movie Database not found. Install it now?"
msgstr ""
msgctxt "#60047"
msgid "The Movie Database is not installed."
msgid "The Movie Database has not been installed"
msgstr ""
msgctxt "#60048"
msgid "The TVDB not present.\nInstall it now?"
msgid "The TVDB not found. Install it now?"
msgstr ""
msgctxt "#60049"
msgid "The TVDB is not installed."
msgid "The TVDB has not been installed"
msgstr ""
msgctxt "#60050"
msgid "TheMovieDB not present.\nInstall it now?"
msgid "The Movie Database not found. Install it now?"
msgstr ""
msgctxt "#60051"
msgid "The Movie Database is not installed."
msgid "The Movie Database has not been installed"
msgstr ""
msgctxt "#60052"
@@ -831,7 +831,7 @@ msgid "Do you want to configure this scraper in italian as default option for th
msgstr ""
msgctxt "#60055"
msgid "Error of provider configuration in BD."
msgid "Error configuring the information provider in Kodi database"
msgstr ""
msgctxt "#60056"
@@ -843,11 +843,7 @@ msgid "Video library %s configured"
msgstr ""
msgctxt "#60058"
msgid "You need to restart Kodi for the changes to take effect."
msgstr ""
msgctxt "#60059"
msgid "Congratulations, Kodi's video library has been configured correctly."
msgid "You need to restart Kodi for the changes to take effect"
msgstr ""
msgctxt "#60060"
@@ -991,7 +987,7 @@ msgid "Download starting..."
msgstr ""
msgctxt "#60202"
msgid "R.T : %s"
msgid "ETA: %s"
msgstr ""
msgctxt "#60203"
@@ -1063,15 +1059,15 @@ msgid "Copying the file"
msgstr ""
msgctxt "#60220"
msgid "Error while deleting the file"
msgid "Stop download"
msgstr ""
msgctxt "#60221"
msgid "Error while deleting the directory"
msgid "Play"
msgstr ""
msgctxt "#60222"
msgid "Error while creating the directory"
msgid "Stop all downloads"
msgstr ""
msgctxt "#60223"
@@ -3167,11 +3163,11 @@ msgid "The Movie Database"
msgstr ""
msgctxt "#70094"
msgid "Select scraper for movies"
msgid "Select the information provider for movies"
msgstr ""
msgctxt "#70095"
msgid "Universal Movie Scraper not present.\nInstall it now?"
msgid "Universal Movie Scraper not found. Install it now?"
msgstr ""
msgctxt "#70096"
@@ -3179,7 +3175,7 @@ msgid "Universal Movie Scraper"
msgstr ""
msgctxt "#70097"
msgid "Universal Movie Scraper not installed."
msgid "Universal Movie Scraper has not been installed"
msgstr ""
msgctxt "#70098"
@@ -3187,15 +3183,11 @@ msgid "The TVDB"
msgstr ""
msgctxt "#70099"
msgid "The TVDB not installed."
msgstr ""
msgctxt "#70100"
msgid "The Movie Database not present.\nInstall it now?"
msgid "The TVDB has not been installed"
msgstr ""
msgctxt "#70101"
msgid "Error fixing video library path in BD"
msgid "Error inserting the video library path in Kodi database"
msgstr ""
msgctxt "#70102"
@@ -3207,7 +3199,7 @@ msgid "Video library %s configured"
msgstr ""
msgctxt "#70104"
msgid "Congratulations, the Kodi video library has been configured correctly."
msgid "The Kodi video library has been configured correctly"
msgstr ""
msgctxt "#70105"
@@ -3219,7 +3211,7 @@ msgid "If you choose 'No' you can do it later from 'Configuration > Preferences
msgstr ""
msgctxt "#70107"
msgid "Select scraper for TV shows"
msgid "Select the information provider for TV shows"
msgstr ""
msgctxt "#70108"
@@ -3331,7 +3323,7 @@ msgid "Custom Colours"
msgstr ""
msgctxt "#70136"
msgid "TV show"
msgid "TV shows"
msgstr ""
msgctxt "#70137"
@@ -6104,13 +6096,45 @@ msgid "The video library has been moved"
msgstr ""
msgctxt "#80015"
msgid "Stop download"
msgid "Do you want to configure the Kodi video library?"
msgstr ""
msgctxt "#80016"
msgid "Play"
msgid "Would you like to use custom or default settings?"
msgstr ""
msgctxt "#80017"
msgid "Stop all"
msgid "Custom"
msgstr ""
msgctxt "#80018"
msgid "Default"
msgstr ""
msgctxt "#80019"
msgid "Select the video library path"
msgstr ""
msgctxt "#80020"
msgid "Folder name for movies"
msgstr ""
msgctxt "#80021"
msgid "Folder name for TV shows"
msgstr ""
msgctxt "#80022"
msgid "You can configure the Kodi video library later from the Settings menu inside KoD"
msgstr ""
msgctxt "#80023"
msgid "Configuration of Kodi video library. You will be asked to configure the information providers for movies and TV shows"
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"
msgstr ""
msgctxt "#80025"
msgid "Cleaning database..."
msgstr ""
+77 -53
View File
@@ -794,28 +794,28 @@ msgid "Sync with Trakt started"
msgstr "Sincronizzazione con Trakt iniziata"
msgctxt "#60046"
msgid "TheMovieDB not present.\nInstall it now?"
msgstr "The Movie database non presente.\nInstallare ora?"
msgid "The Movie Database not found. Install it now?"
msgstr "The Movie Database non trovato. Installare ora?"
msgctxt "#60047"
msgid "The Movie Database is not installed."
msgstr "The Movie Database non è installato."
msgid "The Movie Database has not been installed"
msgstr "The Movie Database non è stato installato"
msgctxt "#60048"
msgid "The TVDB not present.\nInstall it now?"
msgstr "The TVDB non presente.\nInstallare ora?"
msgid "The TVDB not found. Install it now?"
msgstr "The TVDB non trovato. Installare ora?"
msgctxt "#60049"
msgid "The TVDB is not installed."
msgstr "The TVDB non è installato."
msgid "The TVDB has not been installed"
msgstr "The TVDB non è stato installato"
msgctxt "#60050"
msgid "TheMovieDB not present.\nInstall it now?"
msgstr "TheMovieDB non presente.\nInstallare ora?"
msgid "The Movie Database not found. Install it now?"
msgstr "The Movie Database non trovato. Installare ora?"
msgctxt "#60051"
msgid "The Movie Database is not installed."
msgstr "The Movie Database non è installato."
msgid "The Movie Database has not been installed"
msgstr "The Movie Database non è stato installato"
msgctxt "#60052"
msgid "Error on setting LibraryPath in BD"
@@ -830,8 +830,8 @@ msgid "Do you want to configure this scraper in italian as default option for th
msgstr "Si desidera configurare questo scraper in italiano come opzione predefinita per le serie TV?"
msgctxt "#60055"
msgid "Error of provider configuration in BD."
msgstr "Errore di configurazione del provider in BD."
msgid "Error configuring the information provider in Kodi database"
msgstr "Errore di configurazione del provider informazioni nel database di Kodi"
msgctxt "#60056"
msgid "Video library %s not configured"
@@ -842,12 +842,8 @@ msgid "Video library %s configured"
msgstr "Videoteca %s configurata"
msgctxt "#60058"
msgid "You need to restart Kodi for the changes to take effect."
msgstr "E' necessario riavviare Kodi affinchè le modifiche abbiano effetto."
msgctxt "#60059"
msgid "Congratulations, Kodi's video library has been configured correctly."
msgstr "Complimenti, la videoteca di Kodi è stata configurata correttamente."
msgid "You need to restart Kodi for the changes to take effect"
msgstr "E' necessario riavviare Kodi affinchè le modifiche abbiano effetto"
msgctxt "#60060"
msgid "Kodi video library configuration"
@@ -990,8 +986,8 @@ msgid "Download starting..."
msgstr "Inizio download..."
msgctxt "#60202"
msgid "R.T. : %s"
msgstr "T.R. : %s"
msgid "ETA: %s"
msgstr "ETA: %s"
msgctxt "#60203"
msgid "Downloader %s/%s"
@@ -1062,16 +1058,16 @@ msgid "Copying the file"
msgstr "Copia del file"
msgctxt "#60220"
msgid "Error while deleting the file"
msgstr "Errore durante l'eliminazione del file"
msgid "Stop download"
msgstr "Ferma download"
msgctxt "#60221"
msgid "Error while deleting the directory"
msgstr "Errore durante l'eliminazione della directory"
msgid "Play"
msgstr "Riproduci"
msgctxt "#60222"
msgid "Error while creating the directory"
msgstr "Errore durante la creazione della directory"
msgid "Stop all downloads"
msgstr "Ferma tutti i download"
msgctxt "#60223"
msgid "Enter another name"
@@ -3166,36 +3162,32 @@ msgid "The Movie Database"
msgstr "The Movie Database"
msgctxt "#70094"
msgid "Select scraper for movies"
msgstr "Seleziona provider info per i film"
msgid "Select the information provider for movies"
msgstr "Seleziona il provider informazioni per i film"
msgctxt "#70095"
msgid "Universal Movie Scraper not present.\nInstall it now?"
msgstr "Universal Movie Scraper\nNon presente.\nInstallarlo ora?"
msgid "Universal Movie Scraper not found. Install it now?"
msgstr "Universal Movie Scraper non trovato. Installarlo ora?"
msgctxt "#70096"
msgid "Universal Movie Scraper"
msgstr "Universal Movie Scraper"
msgctxt "#70097"
msgid "Universal Movie Scraper not installed."
msgstr "Universal Movie Scraper non è stato installato."
msgid "Universal Movie Scraper has not been installed"
msgstr "Universal Movie Scraper non è stato installato"
msgctxt "#70098"
msgid "The TVDB"
msgstr "The TVDB"
msgctxt "#70099"
msgid "The TVDB not installed."
msgstr "The TVDB non è stato installato."
msgctxt "#70100"
msgid "The Movie Database not present.\nInstall it now?"
msgstr "The Movie Database\nNon presente.\nInstallarlo ora?"
msgid "The TVDB has not been installed"
msgstr "The TVDB non è stato installato"
msgctxt "#70101"
msgid "Error fixing video library path in BD"
msgstr "Errore durante la correzione del percorso della videoteca in BD"
msgid "Error inserting the video library path in Kodi database"
msgstr "Errore durante l'inserimento del percorso della videoteca nel database di Kodi"
msgctxt "#70102"
msgid "Video library %s not configured"
@@ -3206,8 +3198,8 @@ msgid "Video library %s configured"
msgstr "Videoteca %s configurata"
msgctxt "#70104"
msgid "Congratulations, the Kodi video library has been configured correctly."
msgstr "Complimenti, la videoteca di Kodi è stata configurata correttamente."
msgid "The Kodi video library has been configured correctly"
msgstr "La libreria di Kodi è stata configurata correttamente"
msgctxt "#70105"
msgid "Do you want KoD to configure the Kodi library? You will be asked to set up scrapers for movies and TV shows."
@@ -3218,8 +3210,8 @@ msgid "If you choose 'No' you can do it later from 'Configuration > Preferences
msgstr "Se Scegli 'No' potrai farlo in seguito da 'Impostazioni > Preferenze > Percorsi'."
msgctxt "#70107"
msgid "Select scraper for TV shows"
msgstr "Seleziona il provider info per le serie TV"
msgid "Select the information provider for TV shows"
msgstr "Seleziona il provider informazioni per le serie TV"
msgctxt "#70108"
msgid "Icons set"
@@ -3330,7 +3322,7 @@ msgid "Custom Colours"
msgstr "Colori Personalizzati"
msgctxt "#70136"
msgid "TV show"
msgid "TV shows"
msgstr "Serie TV"
msgctxt "#70137"
@@ -6104,13 +6096,45 @@ msgid "The video library has been moved"
msgstr "La videoteca è stata spostata"
msgctxt "#80015"
msgid "Stop download"
msgstr "Stoppa download"
msgid "Do you want to configure the Kodi video library?"
msgstr "Vuoi configurare la libreria di Kodi?"
msgctxt "#80016"
msgid "Play"
msgstr "Riproduci"
msgid "Would you like to use custom or default settings?"
msgstr "Desideri utilizzare impostazioni personalizzate o predefinite?"
msgctxt "#80017"
msgid "Stop all"
msgstr "Stoppa tutti"
msgid "Custom"
msgstr "Personalizzate"
msgctxt "#80018"
msgid "Default"
msgstr "Predefinite"
msgctxt "#80019"
msgid "Select the video library path"
msgstr "Seleziona il percorso della videoteca"
msgctxt "#80020"
msgid "Folder name for movies"
msgstr "Nome della cartella per i film"
msgctxt "#80021"
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"
msgctxt "#80023"
msgid "Configuration of Kodi video library. You will be asked to configure the information providers for movies and TV shows"
msgstr "Configurazione della libreria di Kodi. Ti verrà chiesto di 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"
msgctxt "#80025"
msgid "Cleaning database..."
msgstr "Pulizia database..."
-3
View File
@@ -33,10 +33,7 @@
<setting id="folder_movies" type="text" label="70119" default="Film"/>
<setting label="59997" type="lsep"/>
<setting id="videolibrary_kodi_flag" type="number" label="" default="0" visible="false"/>
<setting id="videolibrary_kodi_force" type="bool" label="" default="false" visible="false"/>
<setting id="videolibrary_kodi" type="bool" label="70120" default="false"/>
<!-- <setting id="videolibrary_kodi" type="bool" label="70120" enable="lt(-1,2)+eq(0,false)" default="false"/> -->
<setting id="videolibrary_max_quality" type="bool" label="70729" default="false" visible="true"/>
<setting id="next_ep" type="select" label="70746" lvalues="70752|70747|70748" default="0"/>
<setting id="next_ep_type" type="select" label="70754" lvalues="70755|70756|70757" default="0" visible="eq(-1,2)" subsetting="true"/>
+11 -11
View File
@@ -115,7 +115,7 @@ def mainlist(item):
# if there's at least one downloading
if 4 in estados:
itemlist.insert(0, Item(channel=item.channel, action="stop_all", title=config.get_localized_string(80017),
itemlist.insert(0, Item(channel=item.channel, action="stop_all", title=config.get_localized_string(60222),
contentType=item.contentType, contentChannel=item.contentChannel,
contentSerieName=item.contentSerieName,
text_color=STATUS_COLORS[STATUS_CODES.downloading]))
@@ -254,8 +254,8 @@ def menu(item):
servidor = "Auto"
# Opciones disponibles para el menu
op = [config.get_localized_string(70225), config.get_localized_string(70226), config.get_localized_string(70227),
config.get_localized_string(30165) % (servidor.capitalize()), config.get_localized_string(80015),
config.get_localized_string(80016)]
config.get_localized_string(30165) % (servidor.capitalize()), config.get_localized_string(60220),
config.get_localized_string(60221)]
opciones = []
@@ -369,14 +369,14 @@ def move_to_libray(item):
logger.info('Delete File: ' + str(filetools.join(config.get_videolibrary_path(), FOLDER, path_title, File)))
filetools.remove(filetools.join(config.get_videolibrary_path(), FOLDER, path_title, File))
from platformcode import xbmc_videolibrary
xbmc_videolibrary.update(FOLDER)
if clean == True:
import xbmc
while xbmc.getCondVisibility('Library.IsScanningVideo()'):
xbmc.sleep(500)
xbmc_videolibrary.clean()
if config.get_setting("videolibrary_kodi"):
from platformcode import xbmc_videolibrary
xbmc_videolibrary.update(FOLDER)
if clean == True:
import xbmc
while xbmc.getCondVisibility('Library.IsScanningVideo()'):
xbmc.sleep(500)
xbmc_videolibrary.clean()
if config.get_setting("library_add") == True and config.get_setting("library_move") == False:
if filetools.isfile(final_path):
+38 -41
View File
@@ -20,44 +20,41 @@ def move_videolibrary(current_path, new_path, current_movies_folder, new_movies_
backup_current_path = current_path
backup_new_path = new_path
if current_path != new_path or current_movies_folder != new_movies_folder or current_tvshows_folder != new_tvshows_folder:
notify = False
progress = platformtools.dialog_progress_bg(config.get_localized_string(20000), config.get_localized_string(80011))
current_path = xbmc.translatePath(current_path)
new_path = xbmc.translatePath(new_path)
current_movies_path = filetools.join(current_path, current_movies_folder)
new_movies_path = filetools.join(new_path, new_movies_folder)
current_tvshows_path = os.path.join(current_path, current_tvshows_folder)
new_tvshows_path = os.path.join(new_path, new_tvshows_folder)
notify = False
progress = platformtools.dialog_progress_bg(config.get_localized_string(20000), config.get_localized_string(80011))
current_path = xbmc.translatePath(current_path)
new_path = xbmc.translatePath(new_path)
current_movies_path = filetools.join(current_path, current_movies_folder)
new_movies_path = filetools.join(new_path, new_movies_folder)
current_tvshows_path = os.path.join(current_path, current_tvshows_folder)
new_tvshows_path = os.path.join(new_path, new_tvshows_folder)
config.verify_directories_created()
progress.update(10, config.get_localized_string(20000), config.get_localized_string(80012))
if current_movies_path != new_movies_path:
if filetools.listdir(current_movies_path):
dir_util.copy_tree(current_movies_path, new_movies_path)
notify = True
filetools.rmdirtree(current_movies_path)
progress.update(40)
if current_tvshows_path != new_tvshows_path:
if filetools.listdir(current_tvshows_path):
dir_util.copy_tree(current_tvshows_path, new_tvshows_path)
notify = True
filetools.rmdirtree(current_tvshows_path)
progress.update(70)
if current_path != new_path and not filetools.listdir(current_path) and not "plugin.video.kod\\videolibrary" in current_path:
filetools.rmdirtree(current_path)
config.verify_directories_created()
progress.update(10, config.get_localized_string(20000), config.get_localized_string(80012))
if current_movies_path != new_movies_path:
if filetools.listdir(current_movies_path):
dir_util.copy_tree(current_movies_path, new_movies_path)
notify = True
filetools.rmdirtree(current_movies_path)
progress.update(40)
if current_tvshows_path != new_tvshows_path:
if filetools.listdir(current_tvshows_path):
dir_util.copy_tree(current_tvshows_path, new_tvshows_path)
notify = True
filetools.rmdirtree(current_tvshows_path)
progress.update(70)
if current_path != new_path and not filetools.listdir(current_path) and not "plugin.video.kod\\videolibrary" in current_path:
filetools.rmdirtree(current_path)
if config.is_xbmc() and config.get_setting("videolibrary_kodi"):
set_new_path(backup_current_path, backup_new_path)
update_db(backup_current_path, backup_new_path, current_movies_folder, new_movies_folder, current_tvshows_folder, new_tvshows_folder, progress)
clear_cache()
else:
progress.update(90, config.get_localized_string(20000), config.get_localized_string(80013))
if config.is_xbmc() and config.get_setting("videolibrary_kodi"):
update_sources(backup_current_path, backup_new_path)
update_db(backup_current_path, backup_new_path, current_movies_folder, new_movies_folder, current_tvshows_folder, new_tvshows_folder, progress)
clear_cache()
progress.update(100)
progress.close()
if notify:
platformtools.dialog_notification(config.get_localized_string(20000), config.get_localized_string(80014), icon=0, time=5000, sound=False)
progress.update(100)
progress.close()
if notify:
platformtools.dialog_notification(config.get_localized_string(20000), config.get_localized_string(80014), icon=0, time=5000, sound=False)
def update_db(current_path, new_path, current_movies_folder, new_movies_folder, current_tvshows_folder, new_tvshows_folder, progress):
@@ -95,7 +92,7 @@ def update_db(current_path, new_path, current_movies_folder, new_movies_folder,
nun_records, records = xbmc_videolibrary.execute_sql_kodi(sql)
p = 80
progress.update(90, config.get_localized_string(20000), config.get_localized_string(80013))
progress.update(p, config.get_localized_string(20000), config.get_localized_string(80013))
OLD = old
for OldPath, NewPath in [[current_movies_folder, new_movies_folder], [current_tvshows_folder, new_tvshows_folder]]:
@@ -151,12 +148,12 @@ def update_db(current_path, new_path, current_movies_folder, new_movies_folder,
sql = 'UPDATE episode SET c18="%s" WHERE idEpisode=%s' % (strPath, idEpisode)
nun_records, records = xbmc_videolibrary.execute_sql_kodi(sql)
p += 5
progress.update(90, config.get_localized_string(20000), config.get_localized_string(80013))
progress.update(p, config.get_localized_string(20000), config.get_localized_string(80013))
def clear_videolibrary_db():
def clear_db():
log()
progress = platformtools.dialog_progress_bg(config.get_localized_string(20000), config.get_localized_string(60601))
progress = platformtools.dialog_progress_bg(config.get_localized_string(20000), config.get_localized_string(80025))
progress.update(0)
@@ -217,13 +214,13 @@ def clear_videolibrary_db():
sql = 'DELETE from episode WHERE idEpisode=%s' % idEpisode
nun_records, records = xbmc_videolibrary.execute_sql_kodi(sql)
progress.update(80)
set_new_path(path)
update_sources(path)
clear_cache()
progress.update(100)
progress.close()
def set_new_path(old, new=''):
def update_sources(old, new=''):
log()
if new == old: return
+4 -4
View File
@@ -693,7 +693,7 @@ def update_tvshow(item):
p_dialog.update(0, heading, item.contentSerieName)
import videolibrary_service
if videolibrary_service.update(item.path, p_dialog, 1, 1, item, False) and config.is_xbmc():
if videolibrary_service.update(item.path, p_dialog, 1, 1, item, False) and config.is_xbmc() and config.get_setting("videolibrary_kodi"):
from platformcode import xbmc_videolibrary
xbmc_videolibrary.update(folder=filetools.basename(item.path))
@@ -926,10 +926,10 @@ def delete(item):
if ficheros == []:
filetools.rmdir(_item.path)
if config.is_xbmc():
if config.is_xbmc() and config.get_setting("videolibrary_kodi"):
import xbmc
# esperamos 3 segundos para dar tiempo a borrar los ficheros
xbmc.sleep(3000)
# esperamos 5 segundos para dar tiempo a borrar los ficheros
xbmc.sleep(5000)
# TODO mirar por qué no funciona al limpiar en la videoteca de Kodi al añadirle un path
# limpiamos la videoteca de Kodi
from platformcode import xbmc_videolibrary
+2 -2
View File
@@ -229,7 +229,7 @@ def check_for_update(overwrite=True):
if serie_actualizada:
if config.get_setting("search_new_content", "videolibrary") == 0:
# Actualizamos la videoteca de Kodi: Buscar contenido en la carpeta de la serie
if config.is_xbmc():
if config.is_xbmc() and config.get_setting("videolibrary_kodi"):
from platformcode import xbmc_videolibrary
xbmc_videolibrary.update(folder=filetools.basename(path))
else:
@@ -240,7 +240,7 @@ def check_for_update(overwrite=True):
if config.get_setting("search_new_content", "videolibrary") == 1 and update_when_finished:
# Actualizamos la videoteca de Kodi: Buscar contenido en todas las series
if config.is_xbmc():
if config.is_xbmc() and config.get_setting("videolibrary_kodi"):
from platformcode import xbmc_videolibrary
xbmc_videolibrary.update()