only videos have resolution

This commit is contained in:
j 2012-09-14 00:15:08 +02:00
parent 1bbfa6e0c8
commit 45d7bb3ea3

View file

@ -247,7 +247,7 @@ class File(models.Model):
def json(self, keys=None, user=None): def json(self, keys=None, user=None):
resolution = (self.width, self.height) resolution = (self.width, self.height)
if resolution == (0, 0): if resolution == (0, 0) or self.type != 'video':
resolution = None resolution = None
duration = self.duration duration = self.duration
if self.type != 'video': if self.type != 'video':