diff --git a/couchpotato/core/plugins/renamer/main.py b/couchpotato/core/plugins/renamer/main.py index 194ea22b..1336e899 100755 --- a/couchpotato/core/plugins/renamer/main.py +++ b/couchpotato/core/plugins/renamer/main.py @@ -114,7 +114,7 @@ class Renamer(Plugin): return else: for item in no_process: - if from_folder in item: + if '%s%s' % (from_folder, os.path.sep) in item: log.error('To protect your data, the movie libraries can\'t be inside of or the same as the "from" folder.') return @@ -146,7 +146,7 @@ class Renamer(Plugin): if movie_folder: for item in no_process: - if movie_folder in item: + if '%s%s' % (movie_folder, os.path.sep) in item: log.error('To protect your data, the movie libraries can\'t be inside of or the same as the provided movie folder.') return diff --git a/couchpotato/environment.py b/couchpotato/environment.py index 0f04d838..b393ef94 100644 --- a/couchpotato/environment.py +++ b/couchpotato/environment.py @@ -78,6 +78,7 @@ class Env(object): return s.get(attr, default = default, section = section, type = type) # Set setting + s.addSection(section) s.set(section, attr, value) s.save() diff --git a/couchpotato/runner.py b/couchpotato/runner.py index a89cd086..441b4a1f 100644 --- a/couchpotato/runner.py +++ b/couchpotato/runner.py @@ -8,6 +8,7 @@ from couchpotato.core.helpers.variable import getDataDir, tryInt from logging import handlers from tornado.httpserver import HTTPServer from tornado.web import Application, StaticFileHandler, RedirectHandler +from uuid import uuid4 import locale import logging import os.path @@ -146,7 +147,7 @@ def runCouchPotato(options, base_path, args, data_dir = None, log_dir = None, En Env.set('dev', development) # Disable logging for some modules - for logger_name in ['enzyme', 'guessit', 'subliminal', 'apscheduler']: + for logger_name in ['enzyme', 'guessit', 'subliminal', 'apscheduler', 'tornado']: logging.getLogger(logger_name).setLevel(logging.ERROR) for logger_name in ['gntp', 'migrate']: @@ -217,6 +218,10 @@ def runCouchPotato(options, base_path, args, data_dir = None, log_dir = None, En Env.set('web_base', web_base) api_key = Env.setting('api_key') + if not api_key: + api_key = uuid4().hex + Env.setting('api_key', value = api_key) + api_base = r'%sapi/%s/' % (web_base, api_key) Env.set('api_base', api_base)