# HG changeset patch # User cavaliet # Date 1358855082 -3600 # Node ID a11c8dba822ec3172cfab78ef1d8554cb1227df0 # Parent 66c7a0826bd7c68e6799a43ed6dc99acf9eb4afd correct add_segment in annotation api. version number upgraded to 1.46. diff -r 66c7a0826bd7 -r a11c8dba822e src/ldt/ldt/__init__.py --- a/src/ldt/ldt/__init__.py Tue Jan 22 11:25:55 2013 +0100 +++ b/src/ldt/ldt/__init__.py Tue Jan 22 12:44:42 2013 +0100 @@ -1,4 +1,4 @@ -VERSION = (1, 45, 0, "final", 0) +VERSION = (1, 46, 0, "final", 0) def get_version(): diff -r 66c7a0826bd7 -r a11c8dba822e src/ldt/ldt/api/ldt/resources/annotation.py --- a/src/ldt/ldt/api/ldt/resources/annotation.py Tue Jan 22 11:25:55 2013 +0100 +++ b/src/ldt/ldt/api/ldt/resources/annotation.py Tue Jan 22 12:44:42 2013 +0100 @@ -95,6 +95,13 @@ content = project.contents.get(iri_id=a['media']) + # We update the ids + a['type'] = type_id + a['ensemble'] = ensemble_id + a['id'] = new_id + if not a['content'].has_key('audio') : + a['content']['audio'] = {'src':audio_src, 'href':audio_href} + #add segment add_segment({ "project" : project, @@ -113,13 +120,6 @@ "audio_href" : audio_href, "polemics": adder.get_polemic_syntax(a['content']['title']) }) - - # We update the ids - a['type'] = type_id - a['ensemble'] = ensemble_id - a['id'] = new_id - if not a['content'].has_key('audio') : - a['content']['audio'] = {'src':audio_src, 'href':audio_href} # We save the added annotation and reprotect the contents and projects adder.save(must_reindex=False) diff -r 66c7a0826bd7 -r a11c8dba822e src/ldt/ldt/ldt_utils/views/json.py --- a/src/ldt/ldt/ldt_utils/views/json.py Tue Jan 22 11:25:55 2013 +0100 +++ b/src/ldt/ldt/ldt_utils/views/json.py Tue Jan 22 12:44:42 2013 +0100 @@ -178,6 +178,8 @@ cur_out = cur_in + dur if tc_in<=cur_in and cur_out<=tc_out and ((not remove_zero_dur) or (remove_zero_dur and dur>0.0)): mashup_list["items"].append(res["element_id"]) + if mashup_dict["lists"] is None: + mashup_dict["lists"] = [] mashup_dict["lists"].append(mashup_list) # If asked, we remove the annotations not used in the mashup.