forked from 0x2620/pandora
audio files should not have aspect ratio
This commit is contained in:
parent
9191a9c196
commit
0504eaf227
1 changed files with 8 additions and 3 deletions
|
@ -616,6 +616,9 @@ class Item(models.Model):
|
||||||
if i['parts']:
|
if i['parts']:
|
||||||
i['videoRatio'] = streams[0].aspect_ratio
|
i['videoRatio'] = streams[0].aspect_ratio
|
||||||
i['resolution'] = (streams[0].file.width, streams[0].file.height)
|
i['resolution'] = (streams[0].file.width, streams[0].file.height)
|
||||||
|
if i['resolution'] == (0, 0):
|
||||||
|
del i['resolution']
|
||||||
|
del i['videoRatio']
|
||||||
else:
|
else:
|
||||||
i['duration'] = self.files.filter(
|
i['duration'] = self.files.filter(
|
||||||
Q(selected=True)|Q(wanted=True)
|
Q(selected=True)|Q(wanted=True)
|
||||||
|
@ -916,10 +919,11 @@ class Item(models.Model):
|
||||||
#s.duration = sum([v.duration for v in videos])
|
#s.duration = sum([v.duration for v in videos])
|
||||||
s.duration = sum([v.duration for v in self.streams()])
|
s.duration = sum([v.duration for v in self.streams()])
|
||||||
v = videos[0]
|
v = videos[0]
|
||||||
if v.is_audio:
|
if v.is_audio or not v.info.get('video'):
|
||||||
s.resolution = None
|
s.resolution = None
|
||||||
s.width = None
|
s.width = None
|
||||||
s.height = None
|
s.height = None
|
||||||
|
s.aspectratio = None
|
||||||
else:
|
else:
|
||||||
s.resolution = v.width * v.height
|
s.resolution = v.width * v.height
|
||||||
s.width = v.width
|
s.width = v.width
|
||||||
|
@ -944,6 +948,7 @@ class Item(models.Model):
|
||||||
s.size = None
|
s.size = None
|
||||||
s.volume = None
|
s.volume = None
|
||||||
s.parts = 0
|
s.parts = 0
|
||||||
|
s.aspectratio = None
|
||||||
|
|
||||||
for key in ('hue', 'saturation', 'lightness'):
|
for key in ('hue', 'saturation', 'lightness'):
|
||||||
if key in self.data:
|
if key in self.data:
|
||||||
|
|
Loading…
Reference in a new issue