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,13 +92,17 @@ def parse_path(client, path):
return: return:
return None if file will not be used, dict with parsed item information otherwise 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): if not isinstance(path, unicode):
path = path.decode('utf-8') path = path.decode('utf-8')
info = ox.movie.parse_path(path) 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: if client.folderdepth == 3:
info['director'] = [] info['director'] = []
info['directorSort'] = [] info['directorSort'] = []