movie.py: strip whitespace from beginning and end of path parts

This commit is contained in:
rolux 2012-08-17 15:51:03 +02:00
parent 66b407a6fa
commit 11aa3f2180

View file

@ -86,7 +86,7 @@ def parse_path(path):
string = re.sub('(?<=\w)_ ', ': ', string) string = re.sub('(?<=\w)_ ', ': ', string)
return string return string
data = {} data = {}
parts = map(parse_underscores, path.split('/')) parts = map(lambda x: parse_underscores(x.strip()), path.split('/'))
# subdirectory # subdirectory
if len(parts) > 4: if len(parts) > 4:
data['subdirectory'] = '/'.join(parts[3:-1]) data['subdirectory'] = '/'.join(parts[3:-1])