2020-06-23 03:11:56 +02:00
|
|
|
package core
|
|
|
|
|
|
|
|
import (
|
2020-11-04 02:34:25 +01:00
|
|
|
"github.com/owncast/owncast/config"
|
2020-10-05 19:07:09 +02:00
|
|
|
"github.com/owncast/owncast/models"
|
2020-06-23 03:11:56 +02:00
|
|
|
)
|
|
|
|
|
2020-11-13 00:14:59 +01:00
|
|
|
// GetStatus gets the status of the system.
|
2020-06-23 03:11:56 +02: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-25 07:52:05 +02:00
|
|
|
LastDisconnectTime: _stats.LastDisconnectTime,
|
|
|
|
LastConnectTime: _stats.LastConnectTime,
|
2020-11-04 02:34:25 +01:00
|
|
|
VersionNumber: config.Config.VersionNumber,
|
2020-06-23 03:11:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-13 00:14:59 +01:00
|
|
|
// setBroadcaster will store the current inbound broadcasting details.
|
2020-10-29 22:09:28 +01:00
|
|
|
func setBroadcaster(broadcaster models.Broadcaster) {
|
2020-10-02 09:12:47 +02:00
|
|
|
_broadcaster = &broadcaster
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetBroadcaster() *models.Broadcaster {
|
|
|
|
return _broadcaster
|
|
|
|
}
|