]> git.parisson.com Git - teleforma.git/commitdiff
fix marker parsing with telemeta
authoryomguy <yomguy@parisson.com>
Tue, 15 Jan 2013 09:37:32 +0000 (10:37 +0100)
committeryomguy <yomguy@parisson.com>
Tue, 15 Jan 2013 09:37:32 +0000 (10:37 +0100)
teleforma/management/commands/teleforma-import-seminars.py

index b48c40aa8b45d77a5a0c01467ed7c104b28c23f2..b0cd0ab2099b9a6da97a237245bf3ba912c84457 100644 (file)
@@ -68,12 +68,13 @@ class Command(BaseCommand):
             for filename in files:
                 name = os.path.splitext(filename)[0]
                 ext = os.path.splitext(filename)[1][1:]
-                print filename
                 root_list = root.split(os.sep)
 
                 if ext in self.original_format and not 'preview' in root_list \
                             and not 'preview' in filename and filename[0] != '.':
-                                        # seminar_rank <= 9
+
+                    print filename
+                    # seminar_rank <= 9
                     seminar_rank = int(root_list[-1][0])
                     if len(root_list[-1]) != 1:
                         media_rank = self.media_rank_dict[root_list[-1][1:]]
@@ -147,8 +148,9 @@ class Command(BaseCommand):
                                 print "related added"
                             elif extension[1:] == 'kdenlive':
                                 related, c = MediaItemRelated.objects.get_or_create(item=item, file=r_path)
-                                related.save()
-                                related.parse()
+                                markers = related.parse_markers()
+                                item.title = markers[0]['comment']
+                                item.save()
                                 print "related parsed"
 
                         media, c = Media.objects.get_or_create(item=item, course=course, type=ext)