More API documentation

This commit is contained in:
Ruud committed 2012-02-21 20:42:41 +01:00
1 parent a5cc1859d1
commit b164674ff7
7 files changed
+88 -31

No files matched your search

+6 -9
View File
@@ -33,15 +33,12 @@ class Updater(Plugin):
'desc': 'Get updater information',
'return': {
'type': 'object',
'example': """
{
'repo_name': "Name of used repository",
'last_check': "last checked for update",
'update_version': "available update version or empty",
'version': current_cp_version
}
"""
}
'example': """{
'repo_name': "Name of used repository",
'last_check': "last checked for update",
'update_version': "available update version or empty",
'version': current_cp_version
}"""}
})
addApiView('updater.update', self.doUpdateView)
addApiView('updater.check', self.checkView, docs = {
+22 -4
View File
@@ -58,10 +58,28 @@ class MoviePlugin(Plugin):
}
})
addApiView('movie.available_chars', self.charView)
addApiView('movie.add', self.addView)
addApiView('movie.edit', self.edit)
addApiView('movie.delete', self.delete)
addApiView('movie.add', self.addView, docs = {
'desc': 'Add new movie to the wanted list',
'params': {
'identifier': {'desc': 'IMDB id of the movie your want to add.'},
'profile_id': {'desc': 'ID of quality profile you want the add the movie in. If empty will use the default profile.'},
'title': {'desc': 'Movie title to use for searches. Has to be one of the titles returned by movie.search.'},
}
})
addApiView('movie.edit', self.edit, docs = {
'desc': 'Add new movie to the wanted list',
'params': {
'id': {'desc': 'Movie ID you want to edit'},
'profile_id': {'desc': 'ID of quality profile you want the edit the movie to.'},
'default_title': {'desc': 'Movie title to use for searches. Has to be one of the titles returned by movie.search.'},
}
})
addApiView('movie.delete', self.delete, docs = {
'desc': 'Delete a movie from the wanted list',
'params': {
'id': {'desc': 'Movie ID you want to delete'},
}
})
addEvent('movie.add', self.add)
addEvent('movie.get', self.get)
+12 -2
View File
@@ -16,8 +16,18 @@ class Release(Plugin):
def __init__(self):
addEvent('release.add', self.add)
addApiView('release.download', self.download)
addApiView('release.delete', self.delete)
addApiView('release.download', self.download, docs = {
'desc': 'Send a release manually to the downloaders',
'params': {
'id': {'type': 'id', 'desc': 'ID of the release object in release-table'}
}
})
addApiView('release.delete', self.delete, docs = {
'desc': 'Check for available update',
'params': {
'id': {'type': 'id', 'desc': 'ID of the release object in release-table'}
}
})
def add(self, group):
db = get_session()
+4 -2
View File
@@ -22,7 +22,9 @@ class Renamer(Plugin):
def __init__(self):
addApiView('renamer.scan', self.scanView)
addApiView('renamer.scan', self.scanView, docs = {
'desc': 'For the renamer to check for new files to rename',
})
addEvent('renamer.scan', self.scan)
addEvent('app.load', self.scan)
@@ -31,7 +33,7 @@ class Renamer(Plugin):
def scanView(self):
fireEvent('renamer.scan')
fireEventAsync('renamer.scan')
return jsonified({
'success': True
+7 -1
View File
@@ -29,7 +29,13 @@ class StatusPlugin(Plugin):
addEvent('status.all', self.all)
addEvent('app.initialize', self.fill)
addApiView('status.list', self.list)
addApiView('status.list', self.list, docs = {
'desc': 'Check for available update',
'return': {'type': 'object', 'example': """{
'success': True,
'list': array, statuses
}"""}
})
def list(self):