dont include empty audioTracks array, fixes player view for items without audio tracks

This commit is contained in:
j 2014-07-29 17:39:43 +02:00
parent f7e1749277
commit a520b7edaf

View file

@ -605,6 +605,8 @@ class Item(models.Model):
i['durations'] = [s.duration for s in streams]
i['duration'] = sum(i['durations'])
i['audioTracks'] = self.audio_tracks()
if not i['audioTracks']:
del i['audioTracks']
if not streams:
i['duration'] = self.files.filter(
Q(selected=True)|Q(wanted=True)