aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/main.go b/main.go
index 91a99a8..45a5b51 100644
--- a/main.go
+++ b/main.go
@@ -694,15 +694,17 @@ func cmdDhash(args []string) error {
hasher, hexSHA1 := args[1], args[2:]
if len(hexSHA1) == 0 {
var err error
- hexSHA1, err = dbCollectStrings(`SELECT sha1 FROM image
- WHERE dhash IS NULL`)
+ hexSHA1, err = dbCollectStrings(`
+ SELECT sha1 FROM image WHERE dhash IS NULL`)
if err != nil {
return err
}
}
- // TODO: Try to run the hasher in parallel, somehow.
- // TODO: Show progress in some manner. Perhaps port my propeller code.
+ pb := newProgressBar(len(hexSHA1))
+ defer pb.Stop()
+
+ // TODO: Also run the hasher in parallel, once it becomes a problem.
for _, sha1 := range hexSHA1 {
pathThumb := thumbPath(sha1)
hash, err := makeDhash(hasher, pathThumb)
@@ -715,6 +717,8 @@ func cmdDhash(args []string) error {
if err != nil {
return err
}
+
+ pb.Step()
}
return nil
}