web/ldt/ldt_utils/projectserializer.py
changeset 99 0fb4b009c6eb
parent 98 c9460033138f
parent 95 9bae869b2146
child 100 c5514a2bfdcd
equal deleted inserted replaced
98:c9460033138f 99:0fb4b009c6eb
   296         
   296         
   297         res = doc.xpath("/iri/head/meta[@name='date']/@content")
   297         res = doc.xpath("/iri/head/meta[@name='date']/@content")
   298         if len(res) > 0:
   298         if len(res) > 0:
   299             content_date = res[0]
   299             content_date = res[0]
   300 
   300 
   301         
   301         href = ""
       
   302         meta_item_value = ""
       
   303         if content.videopath:
       
   304             href = content.videopath.rstrip('/') + "/" + content.src
       
   305             meta_item_value = content.videopath.rstrip('/') + "/"
       
   306 
   302         new_media = {
   307         new_media = {
   303              "http://advene.liris.cnrs.fr/ns/frame_of_reference/ms" : "o=0",
   308              "http://advene.liris.cnrs.fr/ns/frame_of_reference/ms" : "o=0",
   304              "id" : content.iri_id,
   309              "id" : content.iri_id,
   305              "href" : content.videopath.rstrip('/') + "/" + content.src,
   310              "href" : href,
   306              "unit" : "ms",
   311              "unit" : "ms",
   307              "origin" : "0",
   312              "origin" : "0",
   308              "meta": {
   313              "meta": {
   309                  "dc:creator" : author,
   314                  "dc:creator" : author,
   310                  "dc:created" : content.creation_date.isoformat(),
   315                  "dc:created" : content.creation_date.isoformat(),
   315                  "dc:title" : content.title,
   320                  "dc:title" : content.title,
   316                  "dc:description" : content.description,
   321                  "dc:description" : content.description,
   317                  "dc:duration" : content.get_duration(),
   322                  "dc:duration" : content.get_duration(),
   318                  "item": {
   323                  "item": {
   319                      "name" : "streamer",
   324                      "name" : "streamer",
   320                      "value": content.videopath.rstrip('/') + "/"
   325                      "value": meta_item_value, 
   321                  },
   326                  },
   322              }
   327              }
   323         }
   328         }
   324         
   329         
   325         self.medias_dict[content.iri_id] = new_media
   330         self.medias_dict[content.iri_id] = new_media