]> git.parisson.com Git - teleforma.git/commitdiff
fix preview delete
authorGuillaume Pellerin <yomguy@parisson.com>
Tue, 31 Dec 2013 10:39:32 +0000 (11:39 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Tue, 31 Dec 2013 10:39:32 +0000 (11:39 +0100)
teleforma/management/commands/teleforma-import-seminar-media.py

index 2624ee616c9584daebd4b2ff8f0620379f648aa9..9c9381a4237e68f68c2dd6408ab43cf30a50c7df 100644 (file)
@@ -72,9 +72,10 @@ class Command(BaseCommand):
             seminar.medias.remove(media)
             self.delete_media(media)
         if seminar.media_preview:
+            preview = seminar.media_preview
             seminar.media_preview = None
             seminar.save()
-            self.delete_media(seminar.media_preview)
+            self.delete_media(preview)
 
     def get_duration(self, file):
         decoder = timeside.decoder.FileDecoder(file)
@@ -167,7 +168,7 @@ class Command(BaseCommand):
                         else:
                             collection = collections[0]
 
-                        id = '_'.join([period.name, '2', collection_id, ext, str(media_rank)])
+                        id = '_'.join([period.name, '10', collection_id, ext, str(media_rank)])
 
                         items = MediaItem.objects.filter(collection=collection, code=id)
                         if not items:
@@ -176,7 +177,6 @@ class Command(BaseCommand):
                         else:
                             item = items[0]
 
-                        print item
                         item.title = name
                         item.file = path