Browse Source

Allow unknown keywords for all api calls. fix #1881

pull/1867/merge
Ruud 12 years ago
parent
commit
5328f7fe69
  1. 8
      couchpotato/core/_base/_core/main.py
  2. 4
      couchpotato/core/_base/updater/main.py
  3. 2
      couchpotato/core/notifications/base.py
  4. 2
      couchpotato/core/notifications/core/main.py
  5. 2
      couchpotato/core/notifications/nmj/main.py
  6. 2
      couchpotato/core/notifications/plex/main.py
  7. 2
      couchpotato/core/notifications/synoindex/main.py
  8. 4
      couchpotato/core/plugins/file/main.py
  9. 2
      couchpotato/core/plugins/log/main.py
  10. 2
      couchpotato/core/plugins/manage/main.py
  11. 6
      couchpotato/core/plugins/movie/main.py
  12. 4
      couchpotato/core/plugins/profile/main.py
  13. 2
      couchpotato/core/plugins/quality/main.py
  14. 4
      couchpotato/core/plugins/searcher/main.py
  15. 2
      couchpotato/core/plugins/status/main.py
  16. 4
      couchpotato/core/plugins/userscript/main.py
  17. 2
      couchpotato/core/settings/__init__.py

8
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()
}

4
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:

2
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()

2
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

2
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()
}

2
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()

2
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)
}

4
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()

2
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 '')

2
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
}

6
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)

4
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()

2
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,

4
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

2
couchpotato/core/plugins/status/main.py

@ -41,7 +41,7 @@ class StatusPlugin(Plugin):
}"""}
})
def list(self):
def list(self, **kwargs):
return {
'success': True,

4
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

2
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()

Loading…
Cancel
Save