movie.py: handle two-letter extensions; don't add 'en' to path
This commit is contained in:
parent
09381f65f4
commit
10b71a5c23
1 changed files with 4 additions and 4 deletions
|
@ -28,7 +28,7 @@ def format_path(data):
|
||||||
'.%s' % data['version'] if data['version'] else '',
|
'.%s' % data['version'] if data['version'] else '',
|
||||||
'.Part %s' % data['part'] if data['part'] else '',
|
'.Part %s' % data['part'] if data['part'] else '',
|
||||||
'.%s' % data['part_title'] if data['part_title'] else '',
|
'.%s' % data['part_title'] if data['part_title'] else '',
|
||||||
'.%s' % data['language'].replace('/', '.') if data['language'] else '',
|
'.%s' % data['language'].replace('/', '.') if not data['language'] in [None, 'en'] else '',
|
||||||
'.%s' % data['extension']
|
'.%s' % data['extension']
|
||||||
)
|
)
|
||||||
]))
|
]))
|
||||||
|
@ -50,7 +50,7 @@ def parse_path(path):
|
||||||
type = 'audio'
|
type = 'audio'
|
||||||
elif string in ['idx', 'srt', 'sub']:
|
elif string in ['idx', 'srt', 'sub']:
|
||||||
type = 'subtitle'
|
type = 'subtitle'
|
||||||
elif string in ['avi', 'm4v', 'mkv', 'mov', 'mpg', 'ogv']:
|
elif string in ['avi', 'm4v', 'mkv', 'mov', 'mpg', 'ogv', 'rm']:
|
||||||
type = 'video'
|
type = 'video'
|
||||||
else:
|
else:
|
||||||
type = None
|
type = None
|
||||||
|
@ -79,7 +79,7 @@ def parse_path(path):
|
||||||
# title, year
|
# title, year
|
||||||
data['title'], data['year'] = parse_title(parts[2])
|
data['title'], data['year'] = parse_title(parts[2])
|
||||||
parts = re.split('\.(?! )', parts[3])
|
parts = re.split('\.(?! )', parts[3])
|
||||||
# season, episode, episode_title
|
# is_episode, season, episode, episode_title
|
||||||
data['season'], data['episode'], data['episode_title'] = parse_series(parts.pop(0))
|
data['season'], data['episode'], data['episode_title'] = parse_series(parts.pop(0))
|
||||||
if data['season'] or data['episode']:
|
if data['season'] or data['episode']:
|
||||||
data['is_episode'] = True
|
data['is_episode'] = True
|
||||||
|
@ -110,7 +110,7 @@ def parse_path(path):
|
||||||
data['part_title'] = parts.pop(0) if re.search('^[A-Z0-9]', parts[0]) else None
|
data['part_title'] = parts.pop(0) if re.search('^[A-Z0-9]', parts[0]) else None
|
||||||
# language
|
# language
|
||||||
data['language'] = None
|
data['language'] = None
|
||||||
while re.search('^[a-z]{2}$', parts[0]):
|
while len(parts) > 1 and re.search('^[a-z]{2}$', parts[0]):
|
||||||
data['language'] = parts.pop(0) if not data['language'] else '%s/%s' % (
|
data['language'] = parts.pop(0) if not data['language'] else '%s/%s' % (
|
||||||
data['language'], parts.pop(0)
|
data['language'], parts.pop(0)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue