equal
deleted
inserted
replaced
|
1 IriSP.serializers.segmentapi = { |
|
2 deSerialize : function(_data, _source) { |
|
3 var _annotationlist = new IriSP.Model.List(_source.directory), |
|
4 _medialist = new IriSP.Model.List(_source.directory); |
|
5 _source.addList("media", _medialist); |
|
6 IriSP._(_data.objects).each(function(_s) { |
|
7 var _ann = new IriSP.Model.Annotation(_s.element_id, _source), |
|
8 _media = _source.getElement(_s.iri_id); |
|
9 if (!_media) { |
|
10 _media = new IriSP.Model.Media(_s.iri_id, _source); |
|
11 _source.getMedias().push(_media); |
|
12 } |
|
13 _ann.setMedia(_s.iri_id); |
|
14 _ann.title = _s.title; |
|
15 _ann.description = _s.abstract; |
|
16 _ann.begin = new IriSP.Model.Time(_s.start_ts); |
|
17 _ann.end = new IriSP.Model.Time(_s.start_ts + _s.duration); |
|
18 _ann.keywords = _s.tags.split(","); |
|
19 _annotationlist.push(_ann); |
|
20 }); |
|
21 _source.addList("annotation", _annotationlist); |
|
22 } |
|
23 } |