Support assigning nil as time instead of setting time as invalid. Fix typo that led to incorrect disconnect time. Maybe addresses #1268?

This commit is contained in:
Gabe Kangas
2021-08-03 17:47:16 -07:00
parent cab963f21c
commit dcc7a7c5c3
7 changed files with 25 additions and 23 deletions

View File

@@ -8,12 +8,12 @@ import (
// Stats holds the stats for the system.
type Stats struct {
SessionMaxViewerCount int `json:"sessionMaxViewerCount"`
OverallMaxViewerCount int `json:"overallMaxViewerCount"`
LastDisconnectTime utils.NullTime `json:"lastDisconnectTime"`
SessionMaxViewerCount int `json:"sessionMaxViewerCount"`
OverallMaxViewerCount int `json:"overallMaxViewerCount"`
LastDisconnectTime *utils.NullTime `json:"lastDisconnectTime"`
StreamConnected bool `json:"-"`
LastConnectTime utils.NullTime `json:"-"`
LastConnectTime *utils.NullTime `json:"-"`
ChatClients map[string]Client `json:"-"`
Viewers map[string]time.Time `json:"-"`
}

View File

@@ -9,8 +9,8 @@ type Status struct {
OverallMaxViewerCount int `json:"overallMaxViewerCount"`
SessionMaxViewerCount int `json:"sessionMaxViewerCount"`
LastConnectTime utils.NullTime `json:"lastConnectTime"`
LastDisconnectTime utils.NullTime `json:"lastDisconnectTime"`
LastConnectTime *utils.NullTime `json:"lastConnectTime"`
LastDisconnectTime *utils.NullTime `json:"lastDisconnectTime"`
VersionNumber string `json:"versionNumber"`
StreamTitle string `json:"streamTitle"`