Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -172,7 +172,7 @@ def get_all_settings_addon():
|
||||
infile.close()
|
||||
|
||||
ret = {}
|
||||
matches = scrapertools.find_multiple_matches(data, '<setting id="([^"]*)" value="([^"]*)')
|
||||
matches = scrapertools.find_multiple_matches(data, '<setting id=\"([^\"]+)\"[^>]*>([^<]*)</setting>')
|
||||
|
||||
for _id, value in matches:
|
||||
ret[_id] = get_setting(_id)
|
||||
@@ -221,17 +221,20 @@ def open_settings():
|
||||
|
||||
# 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 \
|
||||
"""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()
|
||||
verify_directories_created()"""
|
||||
from specials import move_videolibrary
|
||||
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))
|
||||
|
||||
else:
|
||||
# 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)
|
||||
# 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)
|
||||
|
||||
|
||||
def get_setting(name, channel="", server="", default=None):
|
||||
@@ -465,8 +468,8 @@ def verify_directories_created():
|
||||
logger.debug("Creating %s: %s" % (path, saved_path))
|
||||
filetools.mkdir(saved_path)
|
||||
|
||||
config_paths = [["folder_movies", "CINE"],
|
||||
["folder_tvshows", "SERIES"]]
|
||||
config_paths = [["folder_movies", "Film"],
|
||||
["folder_tvshows", "Serie TV"]]
|
||||
|
||||
for path, default in config_paths:
|
||||
saved_path = get_setting(path)
|
||||
|
||||
@@ -777,7 +777,7 @@ def set_content(content_type, silent=False):
|
||||
|
||||
if not continuar:
|
||||
heading = config.get_localized_string(70102) % content_type
|
||||
elif content_type == 'SERIES' and not xbmc.getCondVisibility(
|
||||
elif content_type == 'tvshow' and not xbmc.getCondVisibility(
|
||||
'System.HasAddon(metadata.tvshows.themoviedb.org)'):
|
||||
heading = config.get_localized_string(70103) % content_type
|
||||
msg_text = config.get_localized_string(60058)
|
||||
|
||||
@@ -6081,4 +6081,24 @@ msgstr ""
|
||||
|
||||
msgctxt "#80009"
|
||||
msgid "Would you like to search for new episodes and update video library?"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#80010"
|
||||
msgid "Select the video library path"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#80011"
|
||||
msgid "Verifying folders..."
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#80012"
|
||||
msgid "Moving video library..."
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#80013"
|
||||
msgid "Updating database..."
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#80014"
|
||||
msgid "The video library has been moved"
|
||||
msgstr ""
|
||||
@@ -6081,4 +6081,24 @@ msgstr "La videoteca è stata importata"
|
||||
|
||||
msgctxt "#80009"
|
||||
msgid "Would you like to search for new episodes and update video library?"
|
||||
msgstr "Vuoi cercare i nuovi episodi ed aggiornare la videoteca?"
|
||||
msgstr "Vuoi cercare i nuovi episodi ed aggiornare la videoteca?"
|
||||
|
||||
msgctxt "#80010"
|
||||
msgid "Select the video library path"
|
||||
msgstr "Seleziona il percorso della videoteca"
|
||||
|
||||
msgctxt "#80011"
|
||||
msgid "Verifying folders..."
|
||||
msgstr "Verifica cartelle..."
|
||||
|
||||
msgctxt "#80012"
|
||||
msgid "Moving video library..."
|
||||
msgstr "Spostamento videoteca..."
|
||||
|
||||
msgctxt "#80013"
|
||||
msgid "Updating database..."
|
||||
msgstr "Aggiornamento database..."
|
||||
|
||||
msgctxt "#80014"
|
||||
msgid "The video library has been moved"
|
||||
msgstr "La videoteca è stata spostata"
|
||||
@@ -27,10 +27,10 @@
|
||||
<!-- Videolibrary -->
|
||||
<category label="30131">
|
||||
<setting label="30501" type="lsep"/>
|
||||
<setting id="videolibrarypath" type="action" label="30067" action="RunPlugin(plugin://plugin.video.kod/?ew0KCSJjaGFubmVsIjoibW92ZV92aWRlb2xpYnJhcnkiLA0KCSJhY3Rpb24iOiJzZXRfdmlkZW9saWJyYXJ5X3BhdGgiDQp9)" default="special://profile/addon_data/plugin.video.kod/videolibrary"/>
|
||||
<!-- <setting id="videolibrarypath" type="folder" label="30067" default="special://profile/addon_data/plugin.video.kod/videolibrary"/> -->
|
||||
<setting id="folder_tvshows" type="text" label="70118" default="SERIES"/>
|
||||
<setting id="folder_movies" type="text" label="70119" default="CINE"/>
|
||||
<!-- <setting id="videolibrarypath" type="action" label="30067" action="RunPlugin(plugin://plugin.video.kod/?ew0KCSJjaGFubmVsIjoibW92ZV92aWRlb2xpYnJhcnkiLA0KCSJhY3Rpb24iOiJzZXRfdmlkZW9saWJyYXJ5X3BhdGgiDQp9)" default="special://profile/addon_data/plugin.video.kod/videolibrary"/> -->
|
||||
<setting id="videolibrarypath" type="folder" label="30067" default="special://profile/addon_data/plugin.video.kod/videolibrary" option="writeable"/>
|
||||
<setting id="folder_tvshows" type="text" label="70118" default="Serie TV"/>
|
||||
<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"/>
|
||||
|
||||
@@ -24,7 +24,7 @@ def export_videolibrary(item):
|
||||
return
|
||||
zip_file = xbmc.translatePath(zip_file_folder + "KoD_video_library-" + str(datetime.date.today()) + ".zip")
|
||||
|
||||
p_dialog = platformtools.dialog_progress_bg(config.get_localized_string(80003), config.get_localized_string(20000))
|
||||
p_dialog = platformtools.dialog_progress_bg(config.get_localized_string(20000), config.get_localized_string(80003))
|
||||
p_dialog.update(0)
|
||||
|
||||
if filetools.exists(temp_path):
|
||||
@@ -46,8 +46,7 @@ def export_videolibrary(item):
|
||||
p_dialog.update(100)
|
||||
xbmc.sleep(2000)
|
||||
p_dialog.close()
|
||||
platformtools.dialog_notification(config.get_localized_string(20000), config.get_localized_string(80004), icon=3,
|
||||
time=5000, sound=False)
|
||||
platformtools.dialog_ok(config.get_localized_string(20000), config.get_localized_string(80004))
|
||||
|
||||
|
||||
def import_videolibrary(item):
|
||||
@@ -59,7 +58,7 @@ def import_videolibrary(item):
|
||||
if not platformtools.dialog_yesno(config.get_localized_string(20000), config.get_localized_string(80006)):
|
||||
return
|
||||
|
||||
p_dialog = platformtools.dialog_progress_bg(config.get_localized_string(80007), config.get_localized_string(20000))
|
||||
p_dialog = platformtools.dialog_progress_bg(config.get_localized_string(20000), config.get_localized_string(80007))
|
||||
p_dialog.update(0)
|
||||
|
||||
if filetools.exists(temp_path):
|
||||
@@ -88,8 +87,7 @@ def import_videolibrary(item):
|
||||
p_dialog.update(100)
|
||||
xbmc.sleep(2000)
|
||||
p_dialog.close()
|
||||
platformtools.dialog_notification(config.get_localized_string(20000), config.get_localized_string(80008), icon=3,
|
||||
time=5000, sound=False)
|
||||
platformtools.dialog_ok(config.get_localized_string(20000), config.get_localized_string(80008))
|
||||
|
||||
if platformtools.dialog_yesno(config.get_localized_string(20000), config.get_localized_string(80009)):
|
||||
import videolibrary_service
|
||||
|
||||
@@ -7,14 +7,14 @@ from core.support import log, dbg
|
||||
from distutils import dir_util, file_util
|
||||
from xml.dom import minidom
|
||||
|
||||
global p
|
||||
"""global p
|
||||
p = 0
|
||||
progress = platformtools.dialog_progress('Spostamento Videoteca','Spostamento File')
|
||||
progress = platformtools.dialog_progress('Spostamento Videoteca','Spostamento File')"""
|
||||
|
||||
|
||||
|
||||
|
||||
def set_videolibrary_path(item):
|
||||
"""def set_videolibrary_path(item):
|
||||
log()
|
||||
global p
|
||||
previous_path = config.get_setting('videolibrarypath')
|
||||
@@ -45,9 +45,57 @@ def move_videolibrary(new, old):
|
||||
dir_util.remove_tree(od,1)
|
||||
global p
|
||||
p += 30
|
||||
progress.update(p, '')
|
||||
progress.update(p)"""
|
||||
|
||||
def move_db(new, old):
|
||||
def move_videolibrary(current_path, new_path, current_movies_folder, new_movies_folder, current_tvshows_folder, new_tvshows_folder):
|
||||
log()
|
||||
log('current video library path:', current_path)
|
||||
log('new video library path:', new_path)
|
||||
log('current movies folder:', current_movies_folder)
|
||||
log('new movies folder:', new_movies_folder)
|
||||
log('current tvshows folder:', current_tvshows_folder)
|
||||
log('new tvshows folder:', new_tvshows_folder)
|
||||
|
||||
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)
|
||||
|
||||
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)
|
||||
|
||||
progress.update(90, config.get_localized_string(20000), config.get_localized_string(80013))
|
||||
if config.is_xbmc() and config.get_setting("videolibrary_kodi"):
|
||||
set_new_path(new_path, current_path)
|
||||
update_db(new_path, current_path)
|
||||
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)
|
||||
|
||||
def update_db(new, old):
|
||||
NEW = new
|
||||
OLD = old
|
||||
|
||||
@@ -102,9 +150,9 @@ def move_db(new, old):
|
||||
strPath = record[1].replace(OLD, NEW)
|
||||
sql = 'UPDATE episode SET c18="%s" WHERE idEpisode=%s' % (strPath, idEpisode)
|
||||
nun_records, records = xbmc_videolibrary.execute_sql_kodi(sql)
|
||||
global p
|
||||
"""global p
|
||||
p += 30
|
||||
progress.update(p, '')
|
||||
progress.update(p)"""
|
||||
|
||||
def set_new_path(new, old):
|
||||
write = False
|
||||
|
||||
Reference in New Issue
Block a user