Fix bug getting content_type for "audio only"

This commit is contained in:
KuhnChris 2023-02-11 22:01:01 +01:00
parent b8434ff444
commit 7d333487fe
1 changed files with 5 additions and 1 deletions

View File

@ -1140,7 +1140,11 @@ class Media(models.Model):
def content_type(self):
if not self.downloaded:
return 'video/mp4'
vcodec = self.downloaded_video_codec.lower()
vcodec = self.downloaded_video_codec
if vcodec is None:
return 'audio/ogg'
vcodec = vcodec.lower()
if vcodec == 'vp9':
return 'video/webm'
else: