diff --git a/etiquette/photodb.py b/etiquette/photodb.py index 9d9d00f..2a36465 100644 --- a/etiquette/photodb.py +++ b/etiquette/photodb.py @@ -17,6 +17,7 @@ from . import tag_export from voussoirkit import cacheclass from voussoirkit import configlayers from voussoirkit import pathclass +from voussoirkit import progressbars from voussoirkit import ratelimiter from voussoirkit import spinal from voussoirkit import sqlhelpers @@ -856,9 +857,16 @@ class PDBUtilMixin: return photo log.loud('Hashing file %s to check for rename.', filepath) + + if filepath.size > 100 * (2 ** 20): + progressbar = progressbars.bar1_bytestring() + else: + progressbar = None + sha256 = spinal.hash_file( filepath, hash_class=hashlib.sha256, **hash_kwargs, + progressbar=progressbar, ).hexdigest() same_hash = self.get_photos_by_hash(sha256) diff --git a/frontends/etiquette_cli.py b/frontends/etiquette_cli.py index d023f3d..f2b11c8 100644 --- a/frontends/etiquette_cli.py +++ b/frontends/etiquette_cli.py @@ -7,6 +7,7 @@ from voussoirkit import betterhelp from voussoirkit import interactive from voussoirkit import pathclass from voussoirkit import pipeable +from voussoirkit import progressbars from voussoirkit import ratelimiter from voussoirkit import spinal from voussoirkit import stringtools @@ -460,7 +461,7 @@ def reload_metadata_argparse(args): hash_kwargs = { 'bytes_per_second': args.hash_bytes_per_second, - 'callback_progress': spinal.callback_progress_v1, + 'progressbar': progressbars.Bar1_bytestring, } need_commit = False