From d172ef85e2a888878e54cb83f331749d47e252af Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 28 Jan 2011 15:00:32 +0530 Subject: [PATCH] cuts are not layers, use subtitles.value --- pandora/archive/models.py | 2 +- pandora/item/models.py | 2 -- static/js/pandora.js | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pandora/archive/models.py b/pandora/archive/models.py index 1b2912f..063b94f 100644 --- a/pandora/archive/models.py +++ b/pandora/archive/models.py @@ -195,7 +195,7 @@ class File(models.Model): srts = re.compile('(\d\d:\d\d:\d\d[,.]\d\d\d)\s*-->\s*(\d\d:\d\d:\d\d[,.]\d\d\d)\s*(.+?)\n\n', re.DOTALL) for s in srts.findall(data): - _s = {'in': parseTime(s[0]), 'out': parseTime(s[1]), 'text': s[2].strip()} + _s = {'in': parseTime(s[0]), 'out': parseTime(s[1]), 'value': s[2].strip()} srt.append(_s) return srt diff --git a/pandora/item/models.py b/pandora/item/models.py index 0636728..7a4a3af 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -339,8 +339,6 @@ class Item(models.Model): def get_layers(self): layers = {} - layers['cuts'] = self.data.get('cuts', {}) - layers['subtitles'] = [] #FIXME: should subtitles be stored in Annotation? qs = self.files.filter(is_subtitle=True, is_main=True, available=True) diff --git a/static/js/pandora.js b/static/js/pandora.js index 62f97bd..a6f374f 100755 --- a/static/js/pandora.js +++ b/static/js/pandora.js @@ -1762,11 +1762,11 @@ var pandora = new Ox.App({ })*/; } else if (app.user.ui.itemView == 'timeline') { var video = result.data.item.stream, - cuts = result.data.item.layers.cuts || {}, + cuts = result.data.item.cuts || {}, subtitles = result.data.item.layers.subtitles || [{ 'in': 5, 'out': 10, - 'text': 'This subtitle is just a test...' + 'value': 'This subtitle is just a test...' }]; video.height = video.profiles[0] video.width = parseInt(video.height * video.aspectRatio / 2) * 2;