Mergeado de pelisalacarta-ce el fix de la videoteca
This commit is contained in:
@@ -375,31 +375,20 @@ def update(folder_content=config.get_setting("folder_tvshows"), folder=""):
|
|||||||
"""
|
"""
|
||||||
logger.info(folder)
|
logger.info(folder)
|
||||||
|
|
||||||
if not folder:
|
payload = {
|
||||||
# Actualizar toda la coleccion
|
"jsonrpc": "2.0",
|
||||||
while xbmc.getCondVisibility('Library.IsScanningVideo()'):
|
"method": "VideoLibrary.Scan",
|
||||||
xbmc.sleep(500)
|
"id": 1
|
||||||
xbmc.executebuiltin('UpdateLibrary(video)')
|
}
|
||||||
|
|
||||||
else:
|
|
||||||
# Actualizar una sola carpeta en un hilo independiente
|
|
||||||
|
|
||||||
def update_multi_threads(update_path, lock):
|
|
||||||
lock.acquire()
|
|
||||||
# logger.debug("%s\nINICIO" % update_path)
|
|
||||||
payload = {"jsonrpc": "2.0",
|
|
||||||
"method": "VideoLibrary.Scan",
|
|
||||||
"params": {"directory": update_path}, "id": 1}
|
|
||||||
|
|
||||||
data = get_data(payload)
|
|
||||||
lock.release()
|
|
||||||
# logger.debug("%s\nFIN data: %s" % (update_path, data))
|
|
||||||
|
|
||||||
|
if folder:
|
||||||
videolibrarypath = config.get_videolibrary_config_path()
|
videolibrarypath = config.get_videolibrary_config_path()
|
||||||
|
|
||||||
if folder.endswith('/') or folder.endswith('\\'):
|
if folder.endswith('/') or folder.endswith('\\'):
|
||||||
folder = folder[:-1]
|
folder = folder[:-1]
|
||||||
|
|
||||||
|
update_path = None
|
||||||
|
|
||||||
if videolibrarypath.startswith("special:"):
|
if videolibrarypath.startswith("special:"):
|
||||||
if videolibrarypath.endswith('/'):
|
if videolibrarypath.endswith('/'):
|
||||||
videolibrarypath = videolibrarypath[:-1]
|
videolibrarypath = videolibrarypath[:-1]
|
||||||
@@ -407,9 +396,12 @@ def update(folder_content=config.get_setting("folder_tvshows"), folder=""):
|
|||||||
else:
|
else:
|
||||||
update_path = filetools.join(videolibrarypath, folder_content, folder) + "/"
|
update_path = filetools.join(videolibrarypath, folder_content, folder) + "/"
|
||||||
|
|
||||||
t = threading.Thread(target=update_multi_threads, args=[update_path, threading.Lock()])
|
payload["params"] = {"directory": update_path}
|
||||||
t.setDaemon(True)
|
|
||||||
t.start()
|
while xbmc.getCondVisibility('Library.IsScanningVideo()'):
|
||||||
|
xbmc.sleep(500)
|
||||||
|
|
||||||
|
data = get_data(payload)
|
||||||
|
|
||||||
|
|
||||||
def clean(mostrar_dialogo=False):
|
def clean(mostrar_dialogo=False):
|
||||||
|
|||||||
Reference in New Issue
Block a user