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 {} returns {}
notes: Clips are either {item, in, out} or {annotation}. If index is notes: Clips are either {item, in, out} or {annotation}. If index is
missing, clips will be inserted at the end of the edit. missing, clips will be inserted at the end of the edit.
see: editClip, orderClips, removeClips, sortClips
''' '''
response = json_response() response = json_response()
edit = get_edit_or_404_json(data['edit']) edit = get_edit_or_404_json(data['edit'])
@ -73,12 +74,13 @@ actions.register(addClips, cache=False)
@login_required_json @login_required_json
def removeClips(request, data): def removeClips(request, data):
''' '''
takes { Removes one or more clips from an edit
edit: string takes {
ids: [string] edit: string, // edit id
} ids: [string] // clip ids
returns { }
} returns {}
see: addClips, editClip, orderClips, sortClips
''' '''
response = json_response() response = json_response()
edit = get_edit_or_404_json(data['edit']) edit = get_edit_or_404_json(data['edit'])
@ -100,13 +102,15 @@ actions.register(removeClips, cache=False)
@login_required_json @login_required_json
def editClip(request, data): def editClip(request, data):
''' '''
takes { Edits a clip within an edit
id: string, takes {
in: float, id: string, // clip id
out: float in: float, // in point in seconds
} out: float // out point in seconds
returns { }
} returns {
}
see: addClips, orderClips, removeClips, sortClips
''' '''
response = json_response() response = json_response()
clip = get_object_or_404_json(models.Clip, pk=ox.fromAZ(data['id'])) clip = get_object_or_404_json(models.Clip, pk=ox.fromAZ(data['id']))
@ -137,12 +141,13 @@ actions.register(editClip, cache=False)
@login_required_json @login_required_json
def orderClips(request, data): def orderClips(request, data):
''' '''
takes { takes {
edit: string edit: string, // edit id
ids: [string] ids: [string] // clip ids in new order
} }
returns { returns {
} }
see: addClips, editClip, removeClip, sortClips
''' '''
edit = get_edit_or_404_json(data['edit']) edit = get_edit_or_404_json(data['edit'])
response = json_response() response = json_response()
@ -195,12 +200,14 @@ def _order_clips(edit, sort):
def sortClips(request, data): def sortClips(request, data):
''' '''
takes { takes {
edit: string edit: string, // edit id
sort: obect sort: object // sort
} }
returns { 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']) edit = get_edit_or_404_json(data['edit'])
response = json_response() response = json_response()
@ -211,14 +218,14 @@ actions.register(sortClips, cache=False)
def getEdit(request, data): def getEdit(request, data):
''' '''
takes { takes {
id: id:
keys: [] keys: []
} }
returns { returns {
id: id:
clips: clips:
} }
''' '''
if 'id' in data: if 'id' in data:
response = json_response() response = json_response()