round duration to 3

This commit is contained in:
j 2015-03-26 20:28:07 +05:30
parent f642c010cd
commit 7b401cfe28
2 changed files with 4 additions and 2 deletions

View file

@ -82,7 +82,9 @@ class Edit(models.Model):
# dont add clip if in/out are invalid # dont add clip if in/out are invalid
if not clip.annotation: if not clip.annotation:
duration = clip.item.sort.duration 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 return False
clip.save() clip.save()
ids.insert(index, clip.id) ids.insert(index, clip.id)

View file

@ -189,7 +189,7 @@ pandora.ui.cacheDialog = function() {
keys: ['id', 'clips'] keys: ['id', 'clips']
}, function(result) { }, function(result) {
Ox.unique(result.data.clips.map(function(clip) { Ox.unique(result.data.clips.map(function(clip) {
return clip.item return clip.item;
})).forEach(function(item) { })).forEach(function(item) {
var update = false; var update = false;
pandora.fs.cacheVideo(item, function(data) { pandora.fs.cacheVideo(item, function(data) {