Browse Source

Added profile and quality list to API

pull/110/head
Ruud 13 years ago
parent
commit
754a49fe2f
  1. 14
      couchpotato/core/plugins/profile/main.py
  2. 14
      couchpotato/core/plugins/quality/main.py

14
couchpotato/core/plugins/profile/main.py

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

14
couchpotato/core/plugins/quality/main.py

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

Loading…
Cancel
Save