cuts are not layers, use subtitles.value

This commit is contained in:
j 2011-01-28 15:00:32 +05:30
parent 1880da27c6
commit d172ef85e2
3 changed files with 3 additions and 5 deletions

View file

@ -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) 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): 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) srt.append(_s)
return srt return srt

View file

@ -339,8 +339,6 @@ class Item(models.Model):
def get_layers(self): def get_layers(self):
layers = {} layers = {}
layers['cuts'] = self.data.get('cuts', {})
layers['subtitles'] = [] layers['subtitles'] = []
#FIXME: should subtitles be stored in Annotation? #FIXME: should subtitles be stored in Annotation?
qs = self.files.filter(is_subtitle=True, is_main=True, available=True) qs = self.files.filter(is_subtitle=True, is_main=True, available=True)

View file

@ -1762,11 +1762,11 @@ var pandora = new Ox.App({
})*/; })*/;
} else if (app.user.ui.itemView == 'timeline') { } else if (app.user.ui.itemView == 'timeline') {
var video = result.data.item.stream, var video = result.data.item.stream,
cuts = result.data.item.layers.cuts || {}, cuts = result.data.item.cuts || {},
subtitles = result.data.item.layers.subtitles || [{ subtitles = result.data.item.layers.subtitles || [{
'in': 5, 'in': 5,
'out': 10, 'out': 10,
'text': 'This subtitle is just a test...' 'value': 'This subtitle is just a test...'
}]; }];
video.height = video.profiles[0] video.height = video.profiles[0]
video.width = parseInt(video.height * video.aspectRatio / 2) * 2; video.width = parseInt(video.height * video.aspectRatio / 2) * 2;