2020-06-23 03:11:56 +02:00
|
|
|
package core
|
|
|
|
|
|
|
|
import (
|
2020-10-05 19:07:09 +02:00
|
|
|
"github.com/owncast/owncast/models"
|
2020-06-23 03:11:56 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
//GetStatus gets the status of the system
|
|
|
|
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-06-23 03:11:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-02 09:12:47 +02:00
|
|
|
// SetBroadcaster will store the current inbound broadcasting details
|
|
|
|
func SetBroadcaster(broadcaster models.Broadcaster) {
|
|
|
|
_broadcaster = &broadcaster
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetBroadcaster() *models.Broadcaster {
|
|
|
|
return _broadcaster
|
|
|
|
}
|