movie.py: fix regexp

This commit is contained in:
rolux 2012-08-18 21:35:58 +02:00
parent c5a7e55608
commit d3f8443a15

View file

@ -122,7 +122,7 @@ def parse_path(path):
match = re.search(' \(\d{4}(-(\d{4})?)?\)$', title) match = re.search(' \(\d{4}(-(\d{4})?)?\)$', title)
data['title'] = title[:-len(match.group(0))] if match else title data['title'] = title[:-len(match.group(0))] if match else title
data['year'] = match.group(0)[2:-1] if match else None data['year'] = match.group(0)[2:-1] if match else None
file_title = re.sub('^\.|/|:', '_', data['title']) file_title = re.sub('[/:]', '_', data['title'])
file = re.sub('^' + re.escape(file_title), '', file) file = re.sub('^' + re.escape(file_title), '', file)
parts = re.split('(?<!\s)\.(?=\w)', file) parts = re.split('(?<!\s)\.(?=\w)', file)
title, parts, extension = [ title, parts, extension = [