From dc2be56c6a01e907422bf2dc37b62682ad1f9bdc Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Mon, 4 Feb 2013 22:13:50 +0100 Subject: [PATCH] fix (old) crfpa import --- .../management/commands/teleforma-import-conferences.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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() -- 2.39.5