Browse Source

Do not rename in decode_par2 if the filename didn't change

Closes #1952
pull/1959/head
Safihre 4 years ago
parent
commit
56375b16fe
  1. 4
      sabnzbd/deobfuscate_filenames.py

4
sabnzbd/deobfuscate_filenames.py

@ -64,9 +64,9 @@ def decode_par2(parfile: str) -> List[str]:
with open(filepath, "rb") as fileToMatch:
first16k_data = fileToMatch.read(16384)
# Check if we have this hash
# Check if we have this hash and the filename is different
file_md5of16k = hashlib.md5(first16k_data).digest()
if file_md5of16k in md5of16k:
if file_md5of16k in md5of16k and fn != md5of16k[file_md5of16k]:
new_path = os.path.join(dirname, md5of16k[file_md5of16k])
# Make sure it's a unique name
unique_filename = get_unique_filename(new_path)

Loading…
Cancel
Save