diff --git a/fs/accounting/stats.go b/fs/accounting/stats.go index f13d340a6..35c8d7db4 100644 --- a/fs/accounting/stats.go +++ b/fs/accounting/stats.go @@ -332,10 +332,10 @@ Elapsed time: %10v // Add per transfer stats if required if !fs.Config.StatsOneLine { if !s.checking.empty() { - _, _ = fmt.Fprintf(buf, "Checking:\n%s\n", s.checking.String(s.inProgress)) + _, _ = fmt.Fprintf(buf, "Checking:\n%s\n", s.checking.String(s.inProgress, s.transferring)) } if !s.transferring.empty() { - _, _ = fmt.Fprintf(buf, "Transferring:\n%s\n", s.transferring.String(s.inProgress)) + _, _ = fmt.Fprintf(buf, "Transferring:\n%s\n", s.transferring.String(s.inProgress, nil)) } } diff --git a/fs/accounting/stringset.go b/fs/accounting/stringset.go index 44b472549..52df0ab4b 100644 --- a/fs/accounting/stringset.go +++ b/fs/accounting/stringset.go @@ -63,12 +63,21 @@ func (ss *stringSet) count() int { return len(ss.items) } -// String returns string representation of set items. -func (ss *stringSet) String(progress *inProgress) string { +// String returns string representation of set items excluding any in +// exclude (if set). +func (ss *stringSet) String(progress *inProgress, exclude *stringSet) string { ss.mu.RLock() defer ss.mu.RUnlock() strngs := make([]string, 0, len(ss.items)) for name := range ss.items { + if exclude != nil { + exclude.mu.RLock() + _, found := exclude.items[name] + exclude.mu.RUnlock() + if found { + continue + } + } var out string if acc := progress.get(name); acc != nil { out = acc.String()