avoid doubloon in mashuptag
authorcavaliet
Mon, 07 Jan 2013 17:01:02 +0100
changeset 1054 54b0ac8c4a1f
parent 1050 0eee72ebc2c0
child 1055 43a60bdffe69
avoid doubloon in mashuptag
src/ldt/ldt/ldt_utils/views/json.py
--- a/src/ldt/ldt/ldt_utils/views/json.py	Mon Jan 07 15:50:28 2013 +0100
+++ b/src/ldt/ldt/ldt_utils/views/json.py	Mon Jan 07 17:01:02 2013 +0100
@@ -167,7 +167,7 @@
                 for res in highest_weighted:
                     cur_in = res["start_ts"]
                     cur_out = cur_in + res["duration"]
-                    if tc_in<=cur_in and cur_out<=tc_out and ((not remove_zero_dur) or (remove_zero_dur and res["duration"]>0.0)):
+                    if tc_in<=cur_in and cur_out<=tc_out and ((not remove_zero_dur) or (remove_zero_dur and res["duration"]>0.0)) and (res["element_id"] not in mashup_list["items"]):
                         #mashup_list["items"].append(res["iri_id"] + ", " + res["element_id"] + ", " + str(res["start_ts"]) + ", " + str(res["duration"]) + ", " + str(res["weight"]))
                         #mashup_list["items"].append(res["element_id"] + ", " + str(res["weight"]) + ", " + res["title"])
                         mashup_list["items"].append(res["element_id"])