Aggiunta verifica sui percorsi videoteca KoD / libreria Kodi

This commit is contained in:
axlt2002
2020-04-09 01:16:54 +02:00
parent 93fa9c0156
commit 4fce7cc3af
5 changed files with 44 additions and 4 deletions

View File

@@ -1034,6 +1034,28 @@ def execute_sql_kodi(sql):
return nun_records, records
def check_sources(new_movies_path='', new_tvshows_path=''):
logger.info()
try:
SOURCES_PATH = xbmc.translatePath("special://userdata/sources.xml")
if filetools.isfile(SOURCES_PATH):
xmldoc = minidom.parse(SOURCES_PATH)
# collect nodes
# nodes = xmldoc.getElementsByTagName("video")
video_node = xmldoc.childNodes[0].getElementsByTagName("video")[0]
paths_node = video_node.getElementsByTagName("path")
# check paths
list_path = [p.firstChild.data for p in paths_node]
if new_movies_path in list_path or new_tvshows_path in list_path:
return True
return False
except:
return True
def update_sources(new='', old=''):
logger.info()
if new == old: return True