mirror of
https://github.com/Luzifer/runemetrics.git
synced 2024-12-22 12:11:20 +00:00
Retain older activity messages
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
e0c5fd789b
commit
15d54ac1fd
1 changed files with 20 additions and 0 deletions
20
metrics.go
20
metrics.go
|
@ -127,6 +127,26 @@ func getPlayerInfo(name string, activities int) (*playerInfo, error) {
|
|||
|
||||
out.SkillValues[i].Updated = time.Now()
|
||||
}
|
||||
|
||||
var (
|
||||
lastActivity = out.Activities[len(out.Activities)-1]
|
||||
skip = true
|
||||
)
|
||||
|
||||
for _, a := range playerInfoCache.Activities {
|
||||
// Times are no good match: they might be duplicated, we search
|
||||
// last message which should never duplicate.
|
||||
if a.Details == lastActivity.Details {
|
||||
skip = false
|
||||
continue
|
||||
}
|
||||
|
||||
if skip {
|
||||
continue
|
||||
}
|
||||
|
||||
out.Activities = append(out.Activities, a)
|
||||
}
|
||||
}
|
||||
|
||||
if knownTotalXP != out.TotalXP {
|
||||
|
|
Loading…
Reference in a new issue