From 5cecb50b2ebccabcdc13750880448a882aeb99e9 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Wed, 17 Jun 2020 17:22:43 -0700 Subject: [PATCH] When starting the server provide a default stream offline state --- main.go | 2 +- utils.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index ec7d1cb50..f63c3c555 100644 --- a/main.go +++ b/main.go @@ -24,7 +24,6 @@ var usingExternalStorage = false func main() { log.StandardLogger().Printf("Owncast v%s/%s (%s)", BuildVersion, BuildType, GitCommit) - resetDirectories(configuration) checkConfig(configuration) stats = getSavedStats() stats.Setup() @@ -43,6 +42,7 @@ func main() { go monitorVideoContent(configuration.PrivateHLSPath, configuration, storage) } + resetDirectories(configuration) go startRTMPService() startChatServer() diff --git a/utils.go b/utils.go index 9b965dcc5..b908a8cbd 100644 --- a/utils.go +++ b/utils.go @@ -71,6 +71,12 @@ func resetDirectories(configuration Config) { os.MkdirAll(path.Join(configuration.PrivateHLSPath, strconv.Itoa(0)), 0777) os.MkdirAll(path.Join(configuration.PublicHLSPath, strconv.Itoa(0)), 0777) } + + // Provide default files + showStreamOfflineState(configuration) + if !fileExists("webroot/thumbnail.png") { + copy("static/logo.png", "webroot/thumbnail.png") + } } func getClientIDFromRequest(req *http.Request) string {