Support BitComet empty directories (ew)

This will allow most (if not all) torrents that have been rejected by 'Malformed torrent metadata (path part is empty)'

Adjusts _validate_bytes to disable empty check
Adds the empty check to file tree parsing
This commit is contained in:
TheAMM
2017-05-20 10:12:32 +03:00
parent 358c75036b
commit 4b4a7b9830
2 changed files with 13 additions and 7 deletions

View File

@@ -100,7 +100,9 @@ def handle_torrent_upload(upload_form, uploading_user=None, fromAPI=False):
for directory in path_parts:
current_directory = current_directory.setdefault(directory, {})
current_directory[filename] = file_dict['length']
# Don't add empty filenames (BitComet directory)
if filename:
current_directory[filename] = file_dict['length']
parsed_file_tree = utils.sorted_pathdict(parsed_file_tree)