update api docs

This commit is contained in:
rolux 2014-12-18 13:49:51 +00:00
parent af7ba8b937
commit 51ad1475e0

View file

@ -47,6 +47,7 @@ def addClips(request, data):
returns {}
notes: Clips are either {item, in, out} or {annotation}. If index is
missing, clips will be inserted at the end of the edit.
see: editClip, orderClips, removeClips, sortClips
'''
response = json_response()
edit = get_edit_or_404_json(data['edit'])
@ -73,12 +74,13 @@ actions.register(addClips, cache=False)
@login_required_json
def removeClips(request, data):
'''
Removes one or more clips from an edit
takes {
edit: string
ids: [string]
}
returns {
edit: string, // edit id
ids: [string] // clip ids
}
returns {}
see: addClips, editClip, orderClips, sortClips
'''
response = json_response()
edit = get_edit_or_404_json(data['edit'])
@ -100,13 +102,15 @@ actions.register(removeClips, cache=False)
@login_required_json
def editClip(request, data):
'''
Edits a clip within an edit
takes {
id: string,
in: float,
out: float
id: string, // clip id
in: float, // in point in seconds
out: float // out point in seconds
}
returns {
}
see: addClips, orderClips, removeClips, sortClips
'''
response = json_response()
clip = get_object_or_404_json(models.Clip, pk=ox.fromAZ(data['id']))
@ -138,11 +142,12 @@ actions.register(editClip, cache=False)
def orderClips(request, data):
'''
takes {
edit: string
ids: [string]
edit: string, // edit id
ids: [string] // clip ids in new order
}
returns {
}
see: addClips, editClip, removeClip, sortClips
'''
edit = get_edit_or_404_json(data['edit'])
response = json_response()
@ -196,11 +201,13 @@ def _order_clips(edit, sort):
def sortClips(request, data):
'''
takes {
edit: string
sort: obect
edit: string, // edit id
sort: object // sort
}
returns {
}
note: sort is [{key: string, operator: string}], operator can be '+' or '-'
see: addClips, editClip, orderClips, removeClips
'''
edit = get_edit_or_404_json(data['edit'])
response = json_response()