From: Guillaume Pellerin Date: Mon, 4 Feb 2013 21:13:50 +0000 (+0100) Subject: fix (old) crfpa import X-Git-Tag: 1.1~632^2~3 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=dc2be56c6a01e907422bf2dc37b62682ad1f9bdc;p=teleforma.git fix (old) crfpa import --- diff --git a/teleforma/management/commands/teleforma-import-conferences.py b/teleforma/management/commands/teleforma-import-conferences.py index 87034b36..63fd81f7 100644 --- a/teleforma/management/commands/teleforma-import-conferences.py +++ b/teleforma/management/commands/teleforma-import-conferences.py @@ -68,7 +68,7 @@ class Command(BaseCommand): name = os.path.splitext(filename)[0] ext = os.path.splitext(filename)[1][1:] - if ext in self.original_format: + if ext and (ext in self.original_format or ext in self.transcoded_formats) and name[0] != '.': root_list = root.split(os.sep) public_id = root_list[-1] course = root_list[-2] @@ -120,7 +120,7 @@ class Command(BaseCommand): item.title = name item.file = path - item.approx_duration = self.get_duration(root+os.sep+filename) + #item.approx_duration = self.get_duration(root+os.sep+filename) item.save() files = os.listdir(root) @@ -137,6 +137,7 @@ class Command(BaseCommand): media = Media(conference=conference) media.item = item media.course = conference.course + media.period = conference.period media.course_type = conference.course_type media.type = ext media.set_mime_type()