From a520b7edaf69228180cc82da28be476e54190c60 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 29 Jul 2014 17:39:43 +0200 Subject: [PATCH] dont include empty audioTracks array, fixes player view for items without audio tracks --- pandora/item/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora/item/models.py b/pandora/item/models.py index d63033b9..84062d7a 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -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)