From 88bfe29d28a082228dcc04b5a6fc3fca3811d77e Mon Sep 17 00:00:00 2001 From: evilhero Date: Mon, 14 Jan 2019 09:46:48 -0500 Subject: [PATCH] FIX:(#2158) Fix for metatagging on systems where rarfile was attempted to load from the incorrect source location --- lib/comictaggerlib/comicapi/comicarchive.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/comictaggerlib/comicapi/comicarchive.py b/lib/comictaggerlib/comicapi/comicarchive.py index 6674bf56..a45dc1e4 100644 --- a/lib/comictaggerlib/comicapi/comicarchive.py +++ b/lib/comictaggerlib/comicapi/comicarchive.py @@ -26,7 +26,16 @@ import time import StringIO from natsort import natsorted -from rarfile import rarfile + +try: + site_root = os.path.dirname(os.path.realpath(__file__)) + parent_root = os.path.abspath(os.path.join(site_root, os.pardir)) + lib_path = os.path.abspath(os.path.join(parent_root, os.pardir)) + if lib_path not in sys.path: + sys.path.append(lib_path) + from rarfile import rarfile +except: + from lib.rarfile import rarfile if platform.system() == "Windows": import _subprocess