Merge branch 'load_modules' into add_module_tests

# Conflicts:
#	src/auto_archiver/modules/gsheet_feeder/gsheet_feeder.py
#	src/auto_archiver/utils/misc.py
This commit is contained in:
erinhmclark
2025-02-10 19:00:05 +00:00
3 changed files with 9 additions and 8 deletions

View File

@@ -30,10 +30,10 @@ class HashEnricher(Enricher):
to_enrich.media[i].set("hash", f"{self.algorithm}:{hd}")
def calculate_hash(self, filename) -> str:
hash = None
hash_algo = None
if self.algorithm == "SHA-256":
hash = hashlib.sha256()
hash_algo = hashlib.sha256
elif self.algorithm == "SHA3-512":
hash = hashlib.sha3_512()
hash_algo = hashlib.sha3_512
else: return ""
return calculate_file_hash(filename, hash, self.chunksize)
return calculate_file_hash(filename, hash_algo, self.chunksize)