Allow unknown keywords for all api calls. fix #1881
This commit is contained in:
@@ -67,12 +67,12 @@ class Core(Plugin):
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def available(self):
|
def available(self, **kwargs):
|
||||||
return {
|
return {
|
||||||
'success': True
|
'success': True
|
||||||
}
|
}
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self, **kwargs):
|
||||||
if self.shutdown_started:
|
if self.shutdown_started:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ class Core(Plugin):
|
|||||||
|
|
||||||
return 'shutdown'
|
return 'shutdown'
|
||||||
|
|
||||||
def restart(self):
|
def restart(self, **kwargs):
|
||||||
if self.shutdown_started:
|
if self.shutdown_started:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ class Core(Plugin):
|
|||||||
|
|
||||||
return '%s - %s-%s - v2' % (platf, ver.get('version')['type'], ver.get('version')['hash'])
|
return '%s - %s-%s - v2' % (platf, ver.get('version')['type'], ver.get('version')['hash'])
|
||||||
|
|
||||||
def versionView(self):
|
def versionView(self, **kwargs):
|
||||||
return {
|
return {
|
||||||
'version': self.version()
|
'version': self.version()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,13 +94,13 @@ class Updater(Plugin):
|
|||||||
def info(self, **kwargs):
|
def info(self, **kwargs):
|
||||||
return self.updater.info()
|
return self.updater.info()
|
||||||
|
|
||||||
def checkView(self):
|
def checkView(self, **kwargs):
|
||||||
return {
|
return {
|
||||||
'update_available': self.check(force = True),
|
'update_available': self.check(force = True),
|
||||||
'info': self.updater.info()
|
'info': self.updater.info()
|
||||||
}
|
}
|
||||||
|
|
||||||
def doUpdateView(self):
|
def doUpdateView(self, **kwargs):
|
||||||
|
|
||||||
self.check()
|
self.check()
|
||||||
if not self.updater.update_version:
|
if not self.updater.update_version:
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class Notification(Provider):
|
|||||||
def notify(self, message = '', data = {}, listener = None):
|
def notify(self, message = '', data = {}, listener = None):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test(self):
|
def test(self, **kwargs):
|
||||||
|
|
||||||
test_type = self.testNotifyName()
|
test_type = self.testNotifyName()
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ class CoreNotifier(Notification):
|
|||||||
db.commit()
|
db.commit()
|
||||||
|
|
||||||
|
|
||||||
def markAsRead(self, ids = None):
|
def markAsRead(self, ids = None, **kwargs):
|
||||||
|
|
||||||
ids = splitString(ids) if ids else None
|
ids = splitString(ids) if ids else None
|
||||||
|
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ class NMJ(Notification):
|
|||||||
'success': False
|
'success': False
|
||||||
}
|
}
|
||||||
|
|
||||||
def test(self):
|
def test(self, **kwargs):
|
||||||
return {
|
return {
|
||||||
'success': self.addToLibrary()
|
'success': self.addToLibrary()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ class Plex(Notification):
|
|||||||
log.info('Plex notification to %s successful.', host)
|
log.info('Plex notification to %s successful.', host)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def test(self):
|
def test(self, **kwargs):
|
||||||
|
|
||||||
test_type = self.testNotifyName()
|
test_type = self.testNotifyName()
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class Synoindex(Notification):
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def test(self):
|
def test(self, **kwargs):
|
||||||
return {
|
return {
|
||||||
'success': os.path.isfile(self.index_path)
|
'success': os.path.isfile(self.index_path)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class FileManager(Plugin):
|
|||||||
except:
|
except:
|
||||||
log.error('Failed removing unused file: %s', traceback.format_exc())
|
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')})])
|
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
|
return types
|
||||||
|
|
||||||
def getTypesView(self):
|
def getTypesView(self, **kwargs):
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'types': self.getTypes()
|
'types': self.getTypes()
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ class Logging(Plugin):
|
|||||||
'log': '[0m\n'.join(log_lines),
|
'log': '[0m\n'.join(log_lines),
|
||||||
}
|
}
|
||||||
|
|
||||||
def clear(self):
|
def clear(self, **kwargs):
|
||||||
|
|
||||||
for x in range(0, 50):
|
for x in range(0, 50):
|
||||||
path = '%s%s' % (Env.get('log_path'), '.%s' % x if x > 0 else '')
|
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'):
|
if not Env.get('dev'):
|
||||||
addEvent('app.load', self.updateLibraryQuick)
|
addEvent('app.load', self.updateLibraryQuick)
|
||||||
|
|
||||||
def getProgress(self):
|
def getProgress(self, **kwargs):
|
||||||
return {
|
return {
|
||||||
'progress': self.in_progress
|
'progress': self.in_progress
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ class MoviePlugin(Plugin):
|
|||||||
|
|
||||||
db.expire_all()
|
db.expire_all()
|
||||||
|
|
||||||
def getView(self, id = None):
|
def getView(self, id = None, **kwargs):
|
||||||
|
|
||||||
movie = self.get(id) if id else None
|
movie = self.get(id) if id else None
|
||||||
|
|
||||||
@@ -298,7 +298,7 @@ class MoviePlugin(Plugin):
|
|||||||
'chars': chars,
|
'chars': chars,
|
||||||
}
|
}
|
||||||
|
|
||||||
def refresh(self, id = ''):
|
def refresh(self, id = '', **kwargs):
|
||||||
|
|
||||||
db = get_session()
|
db = get_session()
|
||||||
|
|
||||||
@@ -320,7 +320,7 @@ class MoviePlugin(Plugin):
|
|||||||
'success': True,
|
'success': True,
|
||||||
}
|
}
|
||||||
|
|
||||||
def search(self, q = ''):
|
def search(self, q = '', **kwargs):
|
||||||
|
|
||||||
cache_key = u'%s/%s' % (__name__, simplifyString(q))
|
cache_key = u'%s/%s' % (__name__, simplifyString(q))
|
||||||
movies = Env.get('cache').get(cache_key)
|
movies = Env.get('cache').get(cache_key)
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class ProfilePlugin(Plugin):
|
|||||||
movie.profile_id = default_profile.get('id')
|
movie.profile_id = default_profile.get('id')
|
||||||
db.commit()
|
db.commit()
|
||||||
|
|
||||||
def allView(self):
|
def allView(self, **kwargs):
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'success': True,
|
'success': True,
|
||||||
@@ -128,7 +128,7 @@ class ProfilePlugin(Plugin):
|
|||||||
'success': True
|
'success': True
|
||||||
}
|
}
|
||||||
|
|
||||||
def delete(self, id = None):
|
def delete(self, id = None, **kwargs):
|
||||||
|
|
||||||
db = get_session()
|
db = get_session()
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class QualityPlugin(Plugin):
|
|||||||
def preReleases(self):
|
def preReleases(self):
|
||||||
return self.pre_releases
|
return self.pre_releases
|
||||||
|
|
||||||
def allView(self):
|
def allView(self, **kwargs):
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'success': True,
|
'success': True,
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ class Searcher(Plugin):
|
|||||||
def setCrons(self):
|
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'))
|
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
|
in_progress = self.in_progress
|
||||||
if not in_progress:
|
if not in_progress:
|
||||||
@@ -70,7 +70,7 @@ class Searcher(Plugin):
|
|||||||
'success': not in_progress
|
'success': not in_progress
|
||||||
}
|
}
|
||||||
|
|
||||||
def getProgress(self):
|
def getProgress(self, **kwargs):
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'progress': self.in_progress
|
'progress': self.in_progress
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class StatusPlugin(Plugin):
|
|||||||
}"""}
|
}"""}
|
||||||
})
|
})
|
||||||
|
|
||||||
def list(self):
|
def list(self, **kwargs):
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'success': True,
|
'success': True,
|
||||||
|
|||||||
@@ -35,14 +35,14 @@ class Userscript(Plugin):
|
|||||||
|
|
||||||
return self.renderTemplate(__file__, 'bookmark.js', **params)
|
return self.renderTemplate(__file__, 'bookmark.js', **params)
|
||||||
|
|
||||||
def getIncludes(self):
|
def getIncludes(self, **kwargs):
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'includes': fireEvent('userscript.get_includes', merge = True),
|
'includes': fireEvent('userscript.get_includes', merge = True),
|
||||||
'excludes': fireEvent('userscript.get_excludes', merge = True),
|
'excludes': fireEvent('userscript.get_excludes', merge = True),
|
||||||
}
|
}
|
||||||
|
|
||||||
def getUserScript(self, route):
|
def getUserScript(self, route, **kwargs):
|
||||||
|
|
||||||
klass = self
|
klass = self
|
||||||
|
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ class Settings(object):
|
|||||||
return self.options
|
return self.options
|
||||||
|
|
||||||
|
|
||||||
def view(self):
|
def view(self, **kwargs):
|
||||||
return {
|
return {
|
||||||
'options': self.getOptions(),
|
'options': self.getOptions(),
|
||||||
'values': self.getValues()
|
'values': self.getValues()
|
||||||
|
|||||||
Reference in New Issue
Block a user