title parsing for documents
This commit is contained in:
parent
188dd5df0f
commit
8d83ec760d
1 changed files with 9 additions and 5 deletions
|
@ -92,12 +92,16 @@ 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')
|
||||||
|
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)
|
info = ox.movie.parse_path(path)
|
||||||
if client.folderdepth == 3:
|
if client.folderdepth == 3:
|
||||||
info['director'] = []
|
info['director'] = []
|
||||||
|
|
Loading…
Reference in a new issue