From 5328f7fe6932e586d0d593335f46d2031542b9fa Mon Sep 17 00:00:00 2001 From: Ruud Date: Mon, 24 Jun 2013 21:21:49 +0200 Subject: [PATCH] Allow unknown keywords for all api calls. fix #1881 --- couchpotato/core/_base/_core/main.py | 8 ++++---- couchpotato/core/_base/updater/main.py | 4 ++-- couchpotato/core/notifications/base.py | 2 +- couchpotato/core/notifications/core/main.py | 2 +- couchpotato/core/notifications/nmj/main.py | 2 +- couchpotato/core/notifications/plex/main.py | 2 +- couchpotato/core/notifications/synoindex/main.py | 2 +- couchpotato/core/plugins/file/main.py | 4 ++-- couchpotato/core/plugins/log/main.py | 2 +- couchpotato/core/plugins/manage/main.py | 2 +- couchpotato/core/plugins/movie/main.py | 6 +++--- couchpotato/core/plugins/profile/main.py | 4 ++-- couchpotato/core/plugins/quality/main.py | 2 +- couchpotato/core/plugins/searcher/main.py | 4 ++-- couchpotato/core/plugins/status/main.py | 2 +- couchpotato/core/plugins/userscript/main.py | 4 ++-- couchpotato/core/settings/__init__.py | 2 +- 17 files changed, 27 insertions(+), 27 deletions(-) diff --git a/couchpotato/core/_base/_core/main.py b/couchpotato/core/_base/_core/main.py index 78ffdad..4ad37d6 100644 --- a/couchpotato/core/_base/_core/main.py +++ b/couchpotato/core/_base/_core/main.py @@ -67,12 +67,12 @@ class Core(Plugin): return True - def available(self): + def available(self, **kwargs): return { 'success': True } - def shutdown(self): + def shutdown(self, **kwargs): if self.shutdown_started: return False @@ -82,7 +82,7 @@ class Core(Plugin): return 'shutdown' - def restart(self): + def restart(self, **kwargs): if self.shutdown_started: return False @@ -169,7 +169,7 @@ class Core(Plugin): return '%s - %s-%s - v2' % (platf, ver.get('version')['type'], ver.get('version')['hash']) - def versionView(self): + def versionView(self, **kwargs): return { 'version': self.version() } diff --git a/couchpotato/core/_base/updater/main.py b/couchpotato/core/_base/updater/main.py index ca3c87f..5b61aeb 100644 --- a/couchpotato/core/_base/updater/main.py +++ b/couchpotato/core/_base/updater/main.py @@ -94,13 +94,13 @@ class Updater(Plugin): def info(self, **kwargs): return self.updater.info() - def checkView(self): + def checkView(self, **kwargs): return { 'update_available': self.check(force = True), 'info': self.updater.info() } - def doUpdateView(self): + def doUpdateView(self, **kwargs): self.check() if not self.updater.update_version: diff --git a/couchpotato/core/notifications/base.py b/couchpotato/core/notifications/base.py index 4d8e64f..7418e1a 100644 --- a/couchpotato/core/notifications/base.py +++ b/couchpotato/core/notifications/base.py @@ -49,7 +49,7 @@ class Notification(Provider): def notify(self, message = '', data = {}, listener = None): pass - def test(self): + def test(self, **kwargs): test_type = self.testNotifyName() diff --git a/couchpotato/core/notifications/core/main.py b/couchpotato/core/notifications/core/main.py index 2bc5e18..b6c07f5 100644 --- a/couchpotato/core/notifications/core/main.py +++ b/couchpotato/core/notifications/core/main.py @@ -62,7 +62,7 @@ class CoreNotifier(Notification): db.commit() - def markAsRead(self, ids = None): + def markAsRead(self, ids = None, **kwargs): ids = splitString(ids) if ids else None diff --git a/couchpotato/core/notifications/nmj/main.py b/couchpotato/core/notifications/nmj/main.py index e781938..695f53b 100644 --- a/couchpotato/core/notifications/nmj/main.py +++ b/couchpotato/core/notifications/nmj/main.py @@ -113,7 +113,7 @@ class NMJ(Notification): 'success': False } - def test(self): + def test(self, **kwargs): return { 'success': self.addToLibrary() } diff --git a/couchpotato/core/notifications/plex/main.py b/couchpotato/core/notifications/plex/main.py index df8df3f..86da9cd 100644 --- a/couchpotato/core/notifications/plex/main.py +++ b/couchpotato/core/notifications/plex/main.py @@ -72,7 +72,7 @@ class Plex(Notification): log.info('Plex notification to %s successful.', host) return True - def test(self): + def test(self, **kwargs): test_type = self.testNotifyName() diff --git a/couchpotato/core/notifications/synoindex/main.py b/couchpotato/core/notifications/synoindex/main.py index c3653ca..315520e 100644 --- a/couchpotato/core/notifications/synoindex/main.py +++ b/couchpotato/core/notifications/synoindex/main.py @@ -31,7 +31,7 @@ class Synoindex(Notification): return True - def test(self): + def test(self, **kwargs): return { 'success': os.path.isfile(self.index_path) } diff --git a/couchpotato/core/plugins/file/main.py b/couchpotato/core/plugins/file/main.py index 5ba99f9..cdd67f5 100644 --- a/couchpotato/core/plugins/file/main.py +++ b/couchpotato/core/plugins/file/main.py @@ -79,7 +79,7 @@ class FileManager(Plugin): except: log.error('Failed removing unused file: %s', traceback.format_exc()) - def showCacheFile(self, route): + def showCacheFile(self, route, **kwargs): Env.get('app').add_handlers(".*$", [('%s%s' % (Env.get('api_base'), route), StaticFileHandler, {'path': Env.get('cache_dir')})]) @@ -150,7 +150,7 @@ class FileManager(Plugin): return types - def getTypesView(self): + def getTypesView(self, **kwargs): return { 'types': self.getTypes() diff --git a/couchpotato/core/plugins/log/main.py b/couchpotato/core/plugins/log/main.py index e9fc0e8..ee88b8d 100644 --- a/couchpotato/core/plugins/log/main.py +++ b/couchpotato/core/plugins/log/main.py @@ -114,7 +114,7 @@ class Logging(Plugin): 'log': '[0m\n'.join(log_lines), } - def clear(self): + def clear(self, **kwargs): for x in range(0, 50): path = '%s%s' % (Env.get('log_path'), '.%s' % x if x > 0 else '') diff --git a/couchpotato/core/plugins/manage/main.py b/couchpotato/core/plugins/manage/main.py index 056c1f7..454e765 100644 --- a/couchpotato/core/plugins/manage/main.py +++ b/couchpotato/core/plugins/manage/main.py @@ -47,7 +47,7 @@ class Manage(Plugin): if not Env.get('dev'): addEvent('app.load', self.updateLibraryQuick) - def getProgress(self): + def getProgress(self, **kwargs): return { 'progress': self.in_progress } diff --git a/couchpotato/core/plugins/movie/main.py b/couchpotato/core/plugins/movie/main.py index 1c829e3..0cc98fd 100644 --- a/couchpotato/core/plugins/movie/main.py +++ b/couchpotato/core/plugins/movie/main.py @@ -124,7 +124,7 @@ class MoviePlugin(Plugin): db.expire_all() - def getView(self, id = None): + def getView(self, id = None, **kwargs): movie = self.get(id) if id else None @@ -298,7 +298,7 @@ class MoviePlugin(Plugin): 'chars': chars, } - def refresh(self, id = ''): + def refresh(self, id = '', **kwargs): db = get_session() @@ -320,7 +320,7 @@ class MoviePlugin(Plugin): 'success': True, } - def search(self, q = ''): + def search(self, q = '', **kwargs): cache_key = u'%s/%s' % (__name__, simplifyString(q)) movies = Env.get('cache').get(cache_key) diff --git a/couchpotato/core/plugins/profile/main.py b/couchpotato/core/plugins/profile/main.py index 8309d16..c70d7c9 100644 --- a/couchpotato/core/plugins/profile/main.py +++ b/couchpotato/core/plugins/profile/main.py @@ -45,7 +45,7 @@ class ProfilePlugin(Plugin): movie.profile_id = default_profile.get('id') db.commit() - def allView(self): + def allView(self, **kwargs): return { 'success': True, @@ -128,7 +128,7 @@ class ProfilePlugin(Plugin): 'success': True } - def delete(self, id = None): + def delete(self, id = None, **kwargs): db = get_session() diff --git a/couchpotato/core/plugins/quality/main.py b/couchpotato/core/plugins/quality/main.py index 4440e16..ead8446 100644 --- a/couchpotato/core/plugins/quality/main.py +++ b/couchpotato/core/plugins/quality/main.py @@ -50,7 +50,7 @@ class QualityPlugin(Plugin): def preReleases(self): return self.pre_releases - def allView(self): + def allView(self, **kwargs): return { 'success': True, diff --git a/couchpotato/core/plugins/searcher/main.py b/couchpotato/core/plugins/searcher/main.py index 008c921..3d85a56 100644 --- a/couchpotato/core/plugins/searcher/main.py +++ b/couchpotato/core/plugins/searcher/main.py @@ -57,7 +57,7 @@ class Searcher(Plugin): def setCrons(self): fireEvent('schedule.cron', 'searcher.all', self.allMovies, day = self.conf('cron_day'), hour = self.conf('cron_hour'), minute = self.conf('cron_minute')) - def allMoviesView(self): + def allMoviesView(self, **kwargs): in_progress = self.in_progress if not in_progress: @@ -70,7 +70,7 @@ class Searcher(Plugin): 'success': not in_progress } - def getProgress(self): + def getProgress(self, **kwargs): return { 'progress': self.in_progress diff --git a/couchpotato/core/plugins/status/main.py b/couchpotato/core/plugins/status/main.py index 42c2d59..c8c8f66 100644 --- a/couchpotato/core/plugins/status/main.py +++ b/couchpotato/core/plugins/status/main.py @@ -41,7 +41,7 @@ class StatusPlugin(Plugin): }"""} }) - def list(self): + def list(self, **kwargs): return { 'success': True, diff --git a/couchpotato/core/plugins/userscript/main.py b/couchpotato/core/plugins/userscript/main.py index cf481a7..a76cf58 100644 --- a/couchpotato/core/plugins/userscript/main.py +++ b/couchpotato/core/plugins/userscript/main.py @@ -35,14 +35,14 @@ class Userscript(Plugin): return self.renderTemplate(__file__, 'bookmark.js', **params) - def getIncludes(self): + def getIncludes(self, **kwargs): return { 'includes': fireEvent('userscript.get_includes', merge = True), 'excludes': fireEvent('userscript.get_excludes', merge = True), } - def getUserScript(self, route): + def getUserScript(self, route, **kwargs): klass = self diff --git a/couchpotato/core/settings/__init__.py b/couchpotato/core/settings/__init__.py index 0513710..cdf58aa 100644 --- a/couchpotato/core/settings/__init__.py +++ b/couchpotato/core/settings/__init__.py @@ -168,7 +168,7 @@ class Settings(object): return self.options - def view(self): + def view(self, **kwargs): return { 'options': self.getOptions(), 'values': self.getValues()