diff --git a/pandora_client/__init__.py b/pandora_client/__init__.py index 3168187..a11351c 100755 --- a/pandora_client/__init__.py +++ b/pandora_client/__init__.py @@ -92,13 +92,17 @@ 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') - 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: info['director'] = [] info['directorSort'] = []