From 06f04e8f0bcd90295dc927945e257d1b76e1fd11 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Sat, 4 Apr 2020 18:19:33 +0200 Subject: [PATCH] Revert xbmc_videolibrary --- platformcode/xbmc_videolibrary.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/platformcode/xbmc_videolibrary.py b/platformcode/xbmc_videolibrary.py index 3641e039..0b334103 100644 --- a/platformcode/xbmc_videolibrary.py +++ b/platformcode/xbmc_videolibrary.py @@ -803,23 +803,23 @@ def update_db(current_path, new_path, current_movies_folder, new_movies_folder, path = path.replace(old,new) if sep == '/': path = path.replace('\\','/') else: path = path.replace('/','\\') - if path.endswith(sep + sep): path = path[:-1] + # if path.endswith(sep + sep): path = path[:-1] return path logger.info() - # new = new_path + new = new_path old = current_path - # rename main path for search in the DB - # if new.startswith("special://") or scrapertools.find_single_match(new, r'(^\w+:\/\/)'): - # new = new.replace('/profile/', '/%/').replace('/home/userdata/', '/%/') - # sep = '/' - # else: - # sep = os.sep - # if not new.endswith(sep): - # new += sep + rename main path for search in the DB + if new.startswith("special://") or scrapertools.find_single_match(new, r'(^\w+:\/\/)'): + new = new.replace('/profile/', '/%/').replace('/home/userdata/', '/%/') + sep = '/' + else: + sep = os.sep + if not new.endswith(sep): + new += sep if old.startswith("special://") or scrapertools.find_single_match(old, r'(^\w+:\/\/)'): old = old.replace('/profile/', '/%/').replace('/home/userdata/', '/%/')