fix: fixed replay time computation using actual dates instead of the assumption of one frame per second

This commit is contained in:
evilsocket 2019-03-30 13:59:08 +01:00
commit 54116f7fbe
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
4 changed files with 45 additions and 2 deletions

View file

@ -50,10 +50,18 @@ func (mod *RestAPI) startReplay(filename string) (err error) {
}
}
mod.recStarted = mod.record.Session.StartedAt()
mod.recStopped = mod.record.Session.StoppedAt()
duration := mod.recStopped.Sub(mod.recStarted)
mod.recTime = int(duration.Seconds())
mod.replaying = true
mod.recording = false
mod.Info("loaded %d frames in %s, started replaying ...", mod.record.Session.Frames(), loadedIn)
mod.Info("loaded %s of recording (%d frames) started at %s in %s, started replaying ...",
duration,
mod.record.Session.Frames(),
mod.recStarted,
loadedIn)
return nil
}