]> git.parisson.com Git - teleforma.git/commitdiff
WIP notelemeta
authorYoan Le Clanche <yoanl@pilotsystems.net>
Wed, 1 Jul 2020 09:08:41 +0000 (11:08 +0200)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Wed, 17 Nov 2021 14:30:16 +0000 (15:30 +0100)
teleforma/models/core.py

index 79745814978ae996b36b6b162c96316d49c4036c..3213e7657356d1a702df0d0cb8b9a5232372523e 100755 (executable)
@@ -539,7 +539,7 @@ class Media(MediaBase):
 
     def set_mime_type(self):
         if self.item.file:
-            mime_type = mimetypes.guess_type(self.item.file.path)[0]
+            mime_type = mimetypes.guess_type(self.file.path)[0]
             if mime_type == 'audio/mpeg':
                 self.mime_type = 'audio/mp3'
             else:
@@ -560,7 +560,7 @@ class Media(MediaBase):
         if self.item.title:
             strings.append(self.item.title)
         else:
-            strings.append(os.path.basename(self.item.file.path))
+            strings.append(os.path.basename(self.file.path))
         if self.rank:
             strings.append(str(self.rank))