2020-06-22 20:11:56 -05:00
|
|
|
package core
|
|
|
|
|
|
|
|
import (
|
2020-11-03 17:34:25 -08:00
|
|
|
"github.com/owncast/owncast/config"
|
2020-10-06 01:07:09 +08:00
|
|
|
"github.com/owncast/owncast/models"
|
2020-06-22 20:11:56 -05:00
|
|
|
)
|
|
|
|
|
2020-11-13 00:14:59 +01:00
|
|
|
// GetStatus gets the status of the system.
|
2020-06-22 20:11:56 -05:00
|
|
|
func GetStatus() models.Status {
|
|
|
|
if _stats == nil {
|
|
|
|
return models.Status{}
|
|
|
|
}
|
|
|
|
|
|
|
|
return models.Status{
|
|
|
|
Online: IsStreamConnected(),
|
|
|
|
ViewerCount: len(_stats.Clients),
|
|
|
|
OverallMaxViewerCount: _stats.OverallMaxViewerCount,
|
|
|
|
SessionMaxViewerCount: _stats.SessionMaxViewerCount,
|
2020-06-24 22:52:05 -07:00
|
|
|
LastDisconnectTime: _stats.LastDisconnectTime,
|
|
|
|
LastConnectTime: _stats.LastConnectTime,
|
2020-11-03 17:34:25 -08:00
|
|
|
VersionNumber: config.Config.VersionNumber,
|
2020-06-22 20:11:56 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-13 00:14:59 +01:00
|
|
|
// setBroadcaster will store the current inbound broadcasting details.
|
2020-10-29 14:09:28 -07:00
|
|
|
func setBroadcaster(broadcaster models.Broadcaster) {
|
2020-10-02 00:12:47 -07:00
|
|
|
_broadcaster = &broadcaster
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetBroadcaster() *models.Broadcaster {
|
|
|
|
return _broadcaster
|
|
|
|
}
|