prevent exceptions when metadata loading failed
This commit is contained in:
parent
5a4e6cee58
commit
a7100a0f53
|
@ -866,7 +866,7 @@ class Media(models.Model):
|
|||
# Otherwise, calculate from matched format codes
|
||||
vformat = None
|
||||
aformat = None
|
||||
if '+' in format_str:
|
||||
if format_str and '+' in format_str:
|
||||
# Seperate audio and video streams
|
||||
vformat_code, aformat_code = format_str.split('+')
|
||||
vformat = self.get_format_by_code(vformat_code)
|
||||
|
@ -875,7 +875,7 @@ class Media(models.Model):
|
|||
# Combined stream or audio only
|
||||
cformat = self.get_format_by_code(format_str)
|
||||
aformat = cformat
|
||||
if cformat['vcodec']:
|
||||
if cformat and cformat['vcodec']:
|
||||
# Combined
|
||||
vformat = cformat
|
||||
if vformat:
|
||||
|
|
Loading…
Reference in New Issue