Skip to content

Commit

Permalink
Don't validate disc torrents that have top folder modified
Browse files Browse the repository at this point in the history
  • Loading branch information
Audionut committed Oct 15, 2024
1 parent 8a53fca commit 97a77de
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ async def is_valid_torrent(self, meta, torrent_path, torrenthash, torrent_client

# Reuse if disc and basename matches or --keep-folder was specified
if meta.get('is_disc', None) is not None or (meta['keep_folder'] and meta['isdir']):
torrent_name = torrent.metainfo['info']['name']
if meta['uuid'] != torrent_name:
console.print("Modified file structure, skipping hash")
valid = False
torrent_filepath = os.path.commonpath(torrent.files)
if os.path.basename(meta['path']) in torrent_filepath:
valid = True
Expand Down

0 comments on commit 97a77de

Please sign in to comment.