From 1f5c060bbce06e3e32d8f8f9ce14f575acdd08da Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 22 Aug 2012 17:19:31 +0200 Subject: [PATCH] movie.py: more bugfixes --- ox/movie.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ox/movie.py b/ox/movie.py index f71976e..72ef3b8 100644 --- a/ox/movie.py +++ b/ox/movie.py @@ -295,13 +295,13 @@ def parse_path(path): while data['partTitle'] and len(parts) and not re.search('^[a-z]{2}$', parts[0]): data['partTitle'] += '.%s' % parts.pop(0) # language - data['language'] = parts.pop(0) if len(parts) and re.search('^[a-z]{2}$', parts[0]) and data['type'] == 'subtitle' else None + language = parts.pop(0) if len(parts) and re.search('^[a-z]{2}$', parts[0]) else None # extension data['extension'] = re.sub('^mpeg$', 'mpg', extension.lower()) if extension else None # type data['type'] = parse_type(data['extension']) - if data['type'] == 'subtitle' and not data['language']: - data['language'] = LANGUAGES[0] + if data['type'] == 'subtitle': + data['language'] = language or LANGUAGES[0] # normalizedPath data['normalizedPath'] = format_path(data) return data