From a6aa29aaf76826bfb3a3d085d562c60c73dc9b04 Mon Sep 17 00:00:00 2001 From: evilhero Date: Sat, 9 Jun 2018 14:11:08 -0400 Subject: [PATCH] IMP: when using -fs maintenance method, will now use original parent folder location instead of assuming it is the Comic Location path specififed in the configuration --- mylar/maintenance.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mylar/maintenance.py b/mylar/maintenance.py index 7444caa9..329680c7 100644 --- a/mylar/maintenance.py +++ b/mylar/maintenance.py @@ -90,10 +90,11 @@ class Maintenance(object): for ct in self.dbmylar.execute("SELECT ComicID, ComicLocation FROM comics WHERE ComicLocation like ?", ['%' + os.sep.encode('unicode-escape') + os.sep.encode('unicode-escape') + '%']): st = ct[1].find(os.sep.encode('unicode-escape')+os.sep.encode('unicode-escape')) if st != -1: + rootloc = ct[1][:st] clocation = ct[1][st+2:] if clocation[0] != os.sep.encode('unicode-escape'): - new_path = os.path.join(mylar.CONFIG.DESTINATION_DIR, clocation) - logger.info('[Incorrect slashes in path detected for OS] %s' % os.path.join(mylar.CONFIG.DESTINATION_DIR, ct[1])) + new_path = os.path.join(rootloc, clocation) + logger.info('[Incorrect slashes in path detected for OS] %s' % os.path.join(rootloc, ct[1])) logger.info('[PATH CORRECTION] %s' % new_path) self.comiclist.append({'ComicLocation': new_path, 'ComicID': ct[0]})