From fbe8c9160bbb83b26c040cace230bbd31c63ab11 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 15 Feb 2012 22:55:17 +0530 Subject: [PATCH] remove subtitles.sort from 0xdb config, duration should always be >=0 --- pandora/0xdb.jsonc | 4 ---- pandora/annotation/models.py | 2 +- static/js/pandora/utils.js | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/pandora/0xdb.jsonc b/pandora/0xdb.jsonc index 9f07633c..4677d2af 100644 --- a/pandora/0xdb.jsonc +++ b/pandora/0xdb.jsonc @@ -540,10 +540,6 @@ "hasPlaces": true, "item": "Subtitle", "overlay": true, - "sort": [ - {"id": "words", "title": "Words", "type": "words"}, - {"id": "wordsperminute", "title": "Words per Minute", "type": "wordsperminute"} - ], "type": "text" } ], diff --git a/pandora/annotation/models.py b/pandora/annotation/models.py index 412cdc18..603be1d8 100644 --- a/pandora/annotation/models.py +++ b/pandora/annotation/models.py @@ -188,7 +188,7 @@ class Annotation(models.Model): 'saturation': 'clip__saturation', 'volume': 'clip__volume', }.get(key, key)) - j['duration'] = j['out'] - j['in'] + j['duration'] = abs(j['out'] - j['in']) if user: j['editable'] = self.editable(user) diff --git a/static/js/pandora/utils.js b/static/js/pandora/utils.js index ec9b33f0..61b12e7c 100644 --- a/static/js/pandora/utils.js +++ b/static/js/pandora/utils.js @@ -803,7 +803,7 @@ pandora.getVideoOptions = function(data) { pandora.site.layers.forEach(function(layer, i) { options.layers[i] = Ox.extend({}, layer, { items: data.layers[layer.id].map(function(annotation) { - annotation.duration = annotation.out - annotation['in']; + annotation.duration = Math.abs(annotation.out - annotation['in']); annotation.editable = annotation.editable || annotation.user == pandora.user.username || pandora.site.capabilities['canEditAnnotations'][pandora.user.level];