restore: pass action enum to restore progress

This commit is contained in:
Michael Eischer
2024-07-05 20:41:27 +02:00
parent 798256ec52
commit ae978d60cc
4 changed files with 28 additions and 26 deletions
+1 -7
View File
@@ -88,7 +88,7 @@ func (p *Progress) AddFile(size uint64) {
}
// AddProgress accumulates the number of bytes written for a file
func (p *Progress) AddProgress(name string, isDir bool, isNew bool, bytesWrittenPortion uint64, bytesTotal uint64) {
func (p *Progress) AddProgress(name string, action ItemAction, bytesWrittenPortion uint64, bytesTotal uint64) {
if p == nil {
return
}
@@ -108,12 +108,6 @@ func (p *Progress) AddProgress(name string, isDir bool, isNew bool, bytesWritten
delete(p.progressInfoMap, name)
p.s.FilesFinished++
action := ActionFileUpdated
if isDir {
action = ActionDirRestored
} else if isNew {
action = ActionFileRestored
}
p.printer.CompleteItem(action, name, bytesTotal)
}
}