title parsing for documents

This commit is contained in:
j 2015-09-24 19:11:56 +01:00
parent 188dd5df0f
commit 8d83ec760d

View file

@ -92,12 +92,16 @@ def parse_path(client, path):
return:
return None if file will not be used, dict with parsed item information otherwise
'''
parts = path.split('/')
if len(parts) != client.folderdepth and (len(parts) < client.folderdepth or \
parts[client.folderdepth-1] != 'Documents'):
return None
if not isinstance(path, unicode):
path = path.decode('utf-8')
parts = path.split('/')
if len(parts) >= client.folderdepth and parts[client.folderdepth-1] == 'Documents':
info = ox.movie.parse_path(u''.join(
parts[:client.folderdepth-1] + [parts[client.folderdepth-2]]
))
else:
if len(parts) != client.folderdepth:
return None
info = ox.movie.parse_path(path)
if client.folderdepth == 3:
info['director'] = []