From 7b401cfe28b315e9397356d3ac95d1e737afae6a Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 26 Mar 2015 20:28:07 +0530 Subject: [PATCH] round duration to 3 --- pandora/edit/models.py | 4 +++- static/js/cacheDialog.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pandora/edit/models.py b/pandora/edit/models.py index 8a836af9..9a7c66cc 100644 --- a/pandora/edit/models.py +++ b/pandora/edit/models.py @@ -82,7 +82,9 @@ class Edit(models.Model): # dont add clip if in/out are invalid if not clip.annotation: duration = clip.item.sort.duration - if clip.start > clip.end or clip.start >= duration or clip.end > duration: + if clip.start > clip.end \ + or round(clip.start, 3) >= round(duration, 3) \ + or round(clip.end, 3) > round(duration, 3): return False clip.save() ids.insert(index, clip.id) diff --git a/static/js/cacheDialog.js b/static/js/cacheDialog.js index 60f6c6c0..97cc47ab 100644 --- a/static/js/cacheDialog.js +++ b/static/js/cacheDialog.js @@ -189,7 +189,7 @@ pandora.ui.cacheDialog = function() { keys: ['id', 'clips'] }, function(result) { Ox.unique(result.data.clips.map(function(clip) { - return clip.item + return clip.item; })).forEach(function(item) { var update = false; pandora.fs.cacheVideo(item, function(data) {