From bd231488ff53952b0c9e0c86e5cfafa2bc36d219 Mon Sep 17 00:00:00 2001 From: msramalho <19508417+msramalho@users.noreply.github.com> Date: Fri, 28 Jul 2023 13:10:06 +0100 Subject: [PATCH] parameter fix --- src/auto_archiver/core/metadata.py | 2 +- src/auto_archiver/enrichers/hash_enricher.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/auto_archiver/core/metadata.py b/src/auto_archiver/core/metadata.py index 80b596d..5c4bcfa 100644 --- a/src/auto_archiver/core/metadata.py +++ b/src/auto_archiver/core/metadata.py @@ -139,7 +139,7 @@ class Metadata: new_media = [] for m in self.media: h = m.get("hash") - if not h: h = calculate_hash_in_chunks(hashlib.sha256(), 1.6e7, m.filename) + if not h: h = calculate_hash_in_chunks(hashlib.sha256(), int(1.6e7), m.filename) if len(h) and h in media_hashes: continue media_hashes.add(h) new_media.append(m) diff --git a/src/auto_archiver/enrichers/hash_enricher.py b/src/auto_archiver/enrichers/hash_enricher.py index 2321d94..673233b 100644 --- a/src/auto_archiver/enrichers/hash_enricher.py +++ b/src/auto_archiver/enrichers/hash_enricher.py @@ -23,7 +23,7 @@ class HashEnricher(Enricher): def configs() -> dict: return { "algorithm": {"default": "SHA-256", "help": "hash algorithm to use", "choices": ["SHA-256", "SHA3-512"]}, - "chunksize": {"default": 1.6e7, "help": "number of bytes to use when reading files in chunks (if this value is too large you will run out of RAM), default is 16MB"}, + "chunksize": {"default": int(1.6e7), "help": "number of bytes to use when reading files in chunks (if this value is too large you will run out of RAM), default is 16MB"}, } def enrich(self, to_enrich: Metadata) -> None: