# HG changeset patch # User ymh # Date 1358856235 -3600 # Node ID 15dafb5ba55068cef0a7794300977976ff6c5dc8 # Parent 94cca4093b600a89a06eb44a30ca1cae755eafc6# Parent a11c8dba822ec3172cfab78ef1d8554cb1227df0 Merge with a11c8dba822ec3172cfab78ef1d8554cb1227df0 diff -r 94cca4093b60 -r 15dafb5ba550 src/ldt/ldt/__init__.py --- a/src/ldt/ldt/__init__.py Tue Jan 22 13:03:10 2013 +0100 +++ b/src/ldt/ldt/__init__.py Tue Jan 22 13:03:55 2013 +0100 @@ -1,4 +1,4 @@ -VERSION = (1, 45, 0, "final", 0) +VERSION = (1, 46, 0, "final", 0) def get_version(): diff -r 94cca4093b60 -r 15dafb5ba550 src/ldt/ldt/api/ldt/resources/annotation.py --- a/src/ldt/ldt/api/ldt/resources/annotation.py Tue Jan 22 13:03:10 2013 +0100 +++ b/src/ldt/ldt/api/ldt/resources/annotation.py Tue Jan 22 13:03:55 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 94cca4093b60 -r 15dafb5ba550 src/ldt/ldt/ldt_utils/views/json.py --- a/src/ldt/ldt/ldt_utils/views/json.py Tue Jan 22 13:03:10 2013 +0100 +++ b/src/ldt/ldt/ldt_utils/views/json.py Tue Jan 22 13:03:55 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.