Allow unknown keywords for all api calls. fix #1881
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ class NMJ(Notification):
|
||||
'success': False
|
||||
}
|
||||
|
||||
def test(self):
|
||||
def test(self, **kwargs):
|
||||
return {
|
||||
'success': self.addToLibrary()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ class Synoindex(Notification):
|
||||
|
||||
return True
|
||||
|
||||
def test(self):
|
||||
def test(self, **kwargs):
|
||||
return {
|
||||
'success': os.path.isfile(self.index_path)
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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 '')
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class QualityPlugin(Plugin):
|
||||
def preReleases(self):
|
||||
return self.pre_releases
|
||||
|
||||
def allView(self):
|
||||
def allView(self, **kwargs):
|
||||
|
||||
return {
|
||||
'success': True,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -41,7 +41,7 @@ class StatusPlugin(Plugin):
|
||||
}"""}
|
||||
})
|
||||
|
||||
def list(self):
|
||||
def list(self, **kwargs):
|
||||
|
||||
return {
|
||||
'success': True,
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ class Settings(object):
|
||||
return self.options
|
||||
|
||||
|
||||
def view(self):
|
||||
def view(self, **kwargs):
|
||||
return {
|
||||
'options': self.getOptions(),
|
||||
'values': self.getValues()
|
||||
|
||||
Reference in New Issue
Block a user