diff --git a/couchpotato/core/plugins/profile/main.py b/couchpotato/core/plugins/profile/main.py index 54213e7e..0ba0637a 100644 --- a/couchpotato/core/plugins/profile/main.py +++ b/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() diff --git a/couchpotato/core/plugins/quality/main.py b/couchpotato/core/plugins/quality/main.py index 70a7b8bc..63d37be8 100644 --- a/couchpotato/core/plugins/quality/main.py +++ b/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()