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