Skip to content

Commit

Permalink
Early breaks in torrent creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Audionut committed Oct 13, 2024
1 parent ce208d2 commit c27e64e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -2478,13 +2478,17 @@ def calculate_piece_size(cls, total_size, min_size, max_size, files):
if piece_size < our_min_size:
piece_size = our_min_size
break
elif torrent_file_size > 92160: # Break if .torrent size exceeds 90 KiB
elif torrent_file_size > 61440: # Break if .torrent size exceeds 60 KiB
break
elif num_pieces > 2000:
piece_size *= 2
if piece_size > our_max_size:
piece_size = our_max_size
break
elif torrent_file_size > 81920: # Break if .torrent size exceeds 80 KiB
break
elif torrent_file_size < 10240: # Break if .torrent size less than 10 KiB
break
elif torrent_file_size > 102400:
piece_size *= 2
if piece_size > our_max_size:
Expand Down

0 comments on commit c27e64e

Please sign in to comment.