Added profile and quality list to API

This commit is contained in:
Ruud
2012-04-16 23:46:38 +02:00
parent 9362077d9f
commit 754a49fe2f
2 changed files with 28 additions and 0 deletions

View File

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

View File

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