movie.py: more bugfixes
This commit is contained in:
parent
c12914adb5
commit
1f5c060bbc
1 changed files with 3 additions and 3 deletions
|
@ -295,13 +295,13 @@ def parse_path(path):
|
||||||
while data['partTitle'] and len(parts) and not re.search('^[a-z]{2}$', parts[0]):
|
while data['partTitle'] and len(parts) and not re.search('^[a-z]{2}$', parts[0]):
|
||||||
data['partTitle'] += '.%s' % parts.pop(0)
|
data['partTitle'] += '.%s' % parts.pop(0)
|
||||||
# language
|
# 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
|
# extension
|
||||||
data['extension'] = re.sub('^mpeg$', 'mpg', extension.lower()) if extension else None
|
data['extension'] = re.sub('^mpeg$', 'mpg', extension.lower()) if extension else None
|
||||||
# type
|
# type
|
||||||
data['type'] = parse_type(data['extension'])
|
data['type'] = parse_type(data['extension'])
|
||||||
if data['type'] == 'subtitle' and not data['language']:
|
if data['type'] == 'subtitle':
|
||||||
data['language'] = LANGUAGES[0]
|
data['language'] = language or LANGUAGES[0]
|
||||||
# normalizedPath
|
# normalizedPath
|
||||||
data['normalizedPath'] = format_path(data)
|
data['normalizedPath'] = format_path(data)
|
||||||
return data
|
return data
|
||||||
|
|
Loading…
Reference in a new issue