mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
fix: exclude zero entries
This commit is contained in:
parent
561198b203
commit
69627fbe11
@ -163,16 +163,20 @@ func (s *Summary) FillBy(fromType uint8, toType uint8) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
total := (totalWanted - totalActual) / time.Second // workaround
|
||||
if total > 0 {
|
||||
if existingEntryIdx >= 0 {
|
||||
(*typeItems[toType])[existingEntryIdx].Total = (totalWanted - totalActual) / time.Second // workaround
|
||||
(*typeItems[toType])[existingEntryIdx].Total = total
|
||||
} else {
|
||||
*typeItems[toType] = append(*typeItems[toType], &SummaryItem{
|
||||
Type: toType,
|
||||
Key: key,
|
||||
Total: (totalWanted - totalActual) / time.Second, // workaround
|
||||
Total: total,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Summary) TotalTime() time.Duration {
|
||||
var timeSum time.Duration
|
||||
|
Loading…
Reference in New Issue
Block a user