diff --git a/couchpotato/core/_base/updater/main.py b/couchpotato/core/_base/updater/main.py index b2f670b..9ebecce 100644 --- a/couchpotato/core/_base/updater/main.py +++ b/couchpotato/core/_base/updater/main.py @@ -323,8 +323,8 @@ class SourceUpdater(BaseUpdater): def replaceWith(self, path): path = sp(path) - app_dir = ss(Env.get('app_dir')) - data_dir = ss(Env.get('data_dir')) + app_dir = Env.get('app_dir') + data_dir = Env.get('data_dir') # Get list of files we want to overwrite self.deletePyc() diff --git a/couchpotato/core/helpers/encoding.py b/couchpotato/core/helpers/encoding.py index ff6a3e5..4159168 100644 --- a/couchpotato/core/helpers/encoding.py +++ b/couchpotato/core/helpers/encoding.py @@ -78,7 +78,7 @@ def sp(path, *args): # Replace *NIX ambiguous '//' at the beginning of a path with '/' (crashes guessit) path = re.sub('^//', '/', path) - return toUnicode(path) + return path def ek(original, *args): diff --git a/couchpotato/core/plugins/base.py b/couchpotato/core/plugins/base.py index 13eb7ca..7cc4d1c 100644 --- a/couchpotato/core/plugins/base.py +++ b/couchpotato/core/plugins/base.py @@ -113,7 +113,7 @@ class Plugin(object): fireEvent('register_%s' % ('script' if ext in 'js' else 'style'), path + os.path.basename(f), f) def createFile(self, path, content, binary = False): - path = ss(path) + path = sp(path) self.makeDir(os.path.dirname(path)) @@ -131,7 +131,7 @@ class Plugin(object): os.remove(path) def makeDir(self, path): - path = ss(path) + path = sp(path) try: if not os.path.isdir(path): os.makedirs(path, Env.getPermission('folder')) diff --git a/couchpotato/core/plugins/release/main.py b/couchpotato/core/plugins/release/main.py index 0218fa6..8af26fd 100644 --- a/couchpotato/core/plugins/release/main.py +++ b/couchpotato/core/plugins/release/main.py @@ -7,7 +7,7 @@ from CodernityDB.database import RecordDeleted from couchpotato import md5, get_db from couchpotato.api import addApiView from couchpotato.core.event import fireEvent, addEvent -from couchpotato.core.helpers.encoding import ss, toUnicode +from couchpotato.core.helpers.encoding import ss, toUnicode, sp from couchpotato.core.helpers.variable import getTitle from couchpotato.core.logger import CPLog from couchpotato.core.plugins.base import Plugin @@ -190,7 +190,7 @@ class Release(Plugin): for file_type in raw_files: for release_file in raw_files.get(file_type, []): - if os.path.isfile(ss(release_file)): + if os.path.isfile(sp(release_file)): if file_type not in files: files[file_type] = [] files[file_type].append(release_file) diff --git a/couchpotato/core/plugins/renamer.py b/couchpotato/core/plugins/renamer.py index 6d2cd79..0b56ca3 100644 --- a/couchpotato/core/plugins/renamer.py +++ b/couchpotato/core/plugins/renamer.py @@ -757,7 +757,7 @@ Remove it if you want it to be renamed (again, or at least let it try again) return False def moveFile(self, old, dest, forcemove = False): - dest = ss(dest) + dest = sp(dest) try: if forcemove or self.conf('file_action') not in ['copy', 'link']: try: diff --git a/couchpotato/core/plugins/scanner.py b/couchpotato/core/plugins/scanner.py index 167e76c..b8eca4c 100644 --- a/couchpotato/core/plugins/scanner.py +++ b/couchpotato/core/plugins/scanner.py @@ -151,7 +151,7 @@ class Scanner(Plugin): try: files = [] for root, dirs, walk_files in scandir.walk(folder, followlinks=True): - files.extend([sp(os.path.join(root, filename)) for filename in walk_files]) + files.extend([sp(os.path.join(sp(root), ss(filename))) for filename in walk_files]) # Break if CP wants to shut down if self.shuttingDown():