diff --git a/pandoraclient b/pandoraclient old mode 100644 new mode 100755 index 985d497..98a3cec --- a/pandoraclient +++ b/pandoraclient @@ -109,16 +109,20 @@ def organize(): if not file['hash'] in files_by_hash: files_by_hash[file['hash']] = [] files_by_hash[file['hash']].append(file) - # unexpected files + # unexpected files, unknown extensions length = len(path.split('/')) if length < 4: issues['unexpected files'].append(path) elif length == 4: - # add parsed title to item key so that episodes are their own item - key = '%s/%s' % ('/'.join(file['normalizedPath'].split('/')[:-1]), file['title']) - if not key in files_by_item: - files_by_item[key] = [] - files_by_item[key].append(file) + # unknown extensions + if not file['type']: + issues['unknown extensions'].append(path) + else: + # add parsed title to item key so that episodes are their own item + key = '%s/%s' % ('/'.join(file['normalizedPath'].split('/')[:-1]), file['title']) + if not key in files_by_item: + files_by_item[key] = [] + files_by_item[key].append(file) if not dirnames and (not filenames or not filter(lambda x: not is_system_file(x), filenames)): issues['empty directories'].append(relative_path) @@ -130,8 +134,6 @@ def organize(): print 'Scanning for inconsistencies' for key in sorted(files_by_item.keys()): item_files = files_by_item[key] - # unknown extensions - issues['unknown extensions'] += [file['path'] for file in item_files if not file['type']] # missing video, missing subtitles, multiple versions versions = ox.movie.parse_item_files(item_files) main_files = sum([version['files'] for version in versions if version['isMainVersion']], []) @@ -304,7 +306,6 @@ def execute_organize(): source = paths[1] + '.pandora' target = paths[1] try: - print rename_file(source, target) except IOError as error: print "Could not rename '%s' to '%s' (%s)" % (source, target, error) diff --git a/pandoraclient.config.jsonc b/pandoraclient.config.jsonc index bcb048e..36d7f5e 100644 --- a/pandoraclient.config.jsonc +++ b/pandoraclient.config.jsonc @@ -6,6 +6,6 @@ "url": "https://0xdb.org/api/", "username": "", "volumes": { - "cinema": "/Users/rolux/Movies/Cinema/" + "cinema": "/Volumes/rolux/Movies/Cinema/" } } \ No newline at end of file