Added profile and quality list to API
This commit is contained in:
@@ -21,9 +21,23 @@ class ProfilePlugin(Plugin):
|
||||
addApiView('profile.save', self.save)
|
||||
addApiView('profile.save_order', self.saveOrder)
|
||||
addApiView('profile.delete', self.delete)
|
||||
addApiView('profile.list', self.allView, docs = {
|
||||
'desc': 'List all available profiles',
|
||||
'return': {'type': 'object', 'example': """{
|
||||
'success': True,
|
||||
'list': array, profiles
|
||||
}"""}
|
||||
})
|
||||
|
||||
addEvent('app.initialize', self.fill, priority = 90)
|
||||
|
||||
def allView(self):
|
||||
|
||||
return jsonified({
|
||||
'success': True,
|
||||
'list': self.all()
|
||||
})
|
||||
|
||||
def all(self):
|
||||
|
||||
db = get_session()
|
||||
|
||||
@@ -36,9 +36,23 @@ class QualityPlugin(Plugin):
|
||||
addEvent('quality.guess', self.guess)
|
||||
|
||||
addApiView('quality.size.save', self.saveSize)
|
||||
addApiView('quality.list', self.allView, docs = {
|
||||
'desc': 'List all available qualities',
|
||||
'return': {'type': 'object', 'example': """{
|
||||
'success': True,
|
||||
'list': array, qualities
|
||||
}"""}
|
||||
})
|
||||
|
||||
addEvent('app.initialize', self.fill, priority = 10)
|
||||
|
||||
def allView(self):
|
||||
|
||||
return jsonified({
|
||||
'success': True,
|
||||
'list': self.all()
|
||||
})
|
||||
|
||||
def all(self):
|
||||
|
||||
db = get_session()
|
||||
|
||||
Reference in New Issue
Block a user