diff --git a/couchpotato/core/notifications/core/main.py b/couchpotato/core/notifications/core/main.py index c3a1621..4c20094 100644 --- a/couchpotato/core/notifications/core/main.py +++ b/couchpotato/core/notifications/core/main.py @@ -56,7 +56,7 @@ class CoreNotifier(Notification): addEvent('library.update_finish', lambda data: fireEvent('notify.frontend', type = 'library.update', data = data)) def markAsRead(self): - ids = getParam('ids').split(',') + ids = [x.strip() for x in getParam('ids').split(',')] db = get_session() @@ -78,7 +78,7 @@ class CoreNotifier(Notification): q = db.query(Notif) if limit_offset: - splt = limit_offset.split(',') + splt = [x.strip() for x in limit_offset.split(',')] limit = splt[0] offset = 0 if len(splt) is 1 else splt[1] q = q.limit(limit).offset(offset) diff --git a/couchpotato/core/notifications/notifymyandroid/main.py b/couchpotato/core/notifications/notifymyandroid/main.py index 45b07cd..2f84317 100644 --- a/couchpotato/core/notifications/notifymyandroid/main.py +++ b/couchpotato/core/notifications/notifymyandroid/main.py @@ -11,7 +11,7 @@ class NotifyMyAndroid(Notification): if self.isDisabled(): return nma = pynma.PyNMA() - keys = self.conf('api_key').split(',') + keys = [x.strip() for x in self.conf('api_key').split(',')] nma.addkey(keys) nma.developerkey(self.conf('dev_key')) diff --git a/couchpotato/core/notifications/notifymywp/main.py b/couchpotato/core/notifications/notifymywp/main.py index 7c294bf..203fdad 100644 --- a/couchpotato/core/notifications/notifymywp/main.py +++ b/couchpotato/core/notifications/notifymywp/main.py @@ -10,7 +10,7 @@ class NotifyMyWP(Notification): def notify(self, message = '', data = {}): if self.isDisabled(): return - keys = self.conf('api_key').split(',') + keys = [x.strip() for x in self.conf('api_key').split(',')] p = PyNMWP(keys, self.conf('dev_key')) response = p.push(application = self.default_title, event = message, description = message, priority = self.conf('priority'), batch_mode = len(keys) > 1) diff --git a/couchpotato/core/plugins/manage/main.py b/couchpotato/core/plugins/manage/main.py index 52b4227..73e1069 100644 --- a/couchpotato/core/plugins/manage/main.py +++ b/couchpotato/core/plugins/manage/main.py @@ -77,6 +77,6 @@ class Manage(Plugin): def directories(self): try: - return self.conf('library', default = '').split('::') + return [x.strip() for x in self.conf('library', default = '').split('::')] except: return [] diff --git a/couchpotato/core/plugins/movie/main.py b/couchpotato/core/plugins/movie/main.py index 06394bc..e18d000 100644 --- a/couchpotato/core/plugins/movie/main.py +++ b/couchpotato/core/plugins/movie/main.py @@ -139,7 +139,7 @@ class MoviePlugin(Plugin): if limit_offset: - splt = limit_offset.split(',') + splt = [x.strip() for x in limit_offset.split(',')] limit = splt[0] offset = 0 if len(splt) is 1 else splt[1] q2 = q2.limit(limit).offset(offset) @@ -324,7 +324,7 @@ class MoviePlugin(Plugin): available_status = fireEvent('status.get', 'available', single = True) - ids = params.get('id').split(',') + ids = [x.strip() for x in params.get('id').split(',')] for movie_id in ids: m = db.query(Movie).filter_by(id = movie_id).first() @@ -356,7 +356,7 @@ class MoviePlugin(Plugin): params = getParams() - ids = params.get('id').split(',') + ids = [x.strip() for x in params.get('id').split(',')] for movie_id in ids: self.delete(movie_id) diff --git a/couchpotato/core/plugins/score/scores.py b/couchpotato/core/plugins/score/scores.py index 1a2f2b8..2cace04 100644 --- a/couchpotato/core/plugins/score/scores.py +++ b/couchpotato/core/plugins/score/scores.py @@ -40,7 +40,7 @@ def nameScore(name, year): # Contains preferred word nzb_words = re.split('\W+', simplifyString(name)) - preferred_words = Env.setting('preferred_words', section = 'searcher').split(',') + preferred_words = [x.strip() for x in Env.setting('preferred_words', section = 'searcher').split(',')] for word in preferred_words: if word.strip() and word.strip().lower() in nzb_words: score = score + 100 diff --git a/couchpotato/core/plugins/searcher/main.py b/couchpotato/core/plugins/searcher/main.py index 5a3aaf8..4c26f4c 100644 --- a/couchpotato/core/plugins/searcher/main.py +++ b/couchpotato/core/plugins/searcher/main.py @@ -192,13 +192,13 @@ class Searcher(Plugin): movie_name = simplifyString(nzb['name']) nzb_words = re.split('\W+', movie_name) - required_words = self.conf('required_words').split(',') + required_words = [x.strip() for x in self.conf('required_words').split(',')] if self.conf('required_words') and not list(set(nzb_words) & set(required_words)): log.info("NZB doesn't contain any of the required words.") return False - ignored_words = self.conf('ignored_words').split(',') + ignored_words = [x.strip() for x in self.conf('ignored_words').split(',')] blacklisted = list(set(nzb_words) & set(ignored_words)) if self.conf('ignored_words') and blacklisted: log.info("Wrong: '%s' blacklisted words: %s" % (nzb['name'], ", ".join(blacklisted))) diff --git a/couchpotato/core/providers/nzb/newznab/main.py b/couchpotato/core/providers/nzb/newznab/main.py index 5ec6743..99fb771 100644 --- a/couchpotato/core/providers/nzb/newznab/main.py +++ b/couchpotato/core/providers/nzb/newznab/main.py @@ -157,9 +157,9 @@ class Newznab(NZBProvider, RSS): def getHosts(self): - uses = str(self.conf('use')).split(',') - hosts = self.conf('host').split(',') - api_keys = self.conf('api_key').split(',') + uses = [x.strip() for x in str(self.conf('use')).split(',')] + hosts = [x.strip() for x in self.conf('host').split(',')] + api_keys = [x.strip() for x in self.conf('api_key').split(',')] list = [] for nr in range(len(hosts)):