mirror of
https://github.com/JaCoB1123/dupe-finder.git
synced 2025-05-18 06:01:56 +02:00
Also show image hashing bar
This commit is contained in:
parent
a2b5d2e224
commit
6f5eb6a1ca
@ -33,6 +33,8 @@ type FilesMap struct {
|
||||
|
||||
fileHashingBar *mpb.Bar
|
||||
|
||||
imageHashingBar *mpb.Bar
|
||||
|
||||
lock sync.Mutex
|
||||
}
|
||||
|
||||
@ -75,7 +77,7 @@ func (fm *FilesMap) ImageHashingWorker(wg *sync.WaitGroup) {
|
||||
}
|
||||
|
||||
hash, err := calculateImageHash(file.path)
|
||||
//fm.hashingBar.IncrInt64(file.size)
|
||||
fm.imageHashingBar.IncrInt64(file.size)
|
||||
|
||||
if err != nil {
|
||||
log.Printf("Error calculating Hash for image %s: %v\n", file.path, err)
|
||||
|
14
main.go
14
main.go
@ -69,7 +69,19 @@ func main() {
|
||||
decor.AverageSpeed(decor.UnitKiB, "%23.2f"),
|
||||
decor.Name(" "),
|
||||
decor.CurrentKibiByte("%5d"),
|
||||
))
|
||||
),
|
||||
)
|
||||
filesMap.imageHashingBar = filesMap.progress.AddBar(0,
|
||||
mpb.PrependDecorators(
|
||||
decor.Name("Hashing images "),
|
||||
decor.Elapsed(decor.ET_STYLE_HHMMSS),
|
||||
),
|
||||
mpb.AppendDecorators(
|
||||
decor.AverageSpeed(decor.UnitKiB, "%23.2f"),
|
||||
decor.Name(" "),
|
||||
decor.CurrentKibiByte("%5d"),
|
||||
),
|
||||
)
|
||||
done := make(chan bool)
|
||||
wg := sync.WaitGroup{}
|
||||
for i := 0; i < runtime.GOMAXPROCS(0); i++ {
|
||||
|
Loading…
x
Reference in New Issue
Block a user