fix multilanguage resolution

This commit is contained in:
j 2014-10-24 10:32:16 +01:00
parent 076e64fdff
commit e95c9011e7

View file

@ -469,7 +469,7 @@ class File(models.Model):
while language in languages: while language in languages:
language = '%s%d' % (lang, n) language = '%s%d' % (lang, n)
n += 1 n += 1
profile = '%s.%s' % (resolution, config['formats'][0]) profile = '%sp.%s' % (resolution, config['formats'][0])
target = os.path.join(tmp, language + '_' + profile) target = os.path.join(tmp, language + '_' + profile)
ok, error = extract.stream(media, target, profile, info, ffmpeg, ok, error = extract.stream(media, target, profile, info, ffmpeg,
audio_track=i+1) audio_track=i+1)
@ -477,7 +477,7 @@ class File(models.Model):
tinfo = ox.avinfo(target) tinfo = ox.avinfo(target)
del tinfo['path'] del tinfo['path']
f = File(oshash=tinfo['oshash'], item=self.item) f = File(oshash=tinfo['oshash'], item=self.item)
f.path = self.path f.path = self.path.rsplit('.', 1)[0] + config['formats'][0]
f.info = tinfo f.info = tinfo
f.info['language'] = language f.info['language'] = language
f.info['extension'] = config['formats'][0] f.info['extension'] = config['formats'][0]