Compare commits

...

2 commits

Author SHA1 Message Date
j
a667fc5b5b autocomplete keywords 2023-07-06 16:22:33 +05:30
j
f5becafad4 avoid negative pixels 2023-07-06 16:22:23 +05:30
2 changed files with 4 additions and 1 deletions

View file

@ -151,8 +151,10 @@ class File(models.Model):
self.sampleate = 0
self.channels = 0
if self.framerate:
if self.framerate and self.duration > 0:
self.pixels = int(self.width * self.height * float(utils.parse_decimal(self.framerate)) * self.duration)
else:
self.pixels = 0
def get_path_info(self):
data = {}

View file

@ -1494,6 +1494,7 @@
"hasEvents": true,
"hasPlaces": true,
"item": "Keyword",
"autocomplete": true,
"overlap": true,
"type": "string"
},