Skip to content

🎧 Your Personal Streaming Service

refactor: move banner to consts, closer to version

Deluand1f8d39866ea
diff --git a/banner.go b/consts/banner.go
similarity index 57%
rename from banner.go
rename to consts/banner.go
index e32b80917..00a6b73b4 100644
--- a/banner.go
+++ b/consts/banner.go
@@ -1,10 +1,9 @@
-package main
+package consts
import (
"fmt"
"strings"
- "github.com/deluan/navidrome/consts"
"github.com/deluan/navidrome/static"
)
@@ -13,8 +12,8 @@ func getBanner() string {
return strings.TrimSuffix(string(data), "\n")
}
-func ShowBanner() {
- version := "Version: " + consts.Version()
+func Banner() string {
+ version := "Version: " + Version()
padding := strings.Repeat(" ", 52-len(version))
- fmt.Printf("%s%s%s\n\n", getBanner(), padding, version)
+ return fmt.Sprintf("%s%s%s\n", getBanner(), padding, version)
}
diff --git a/main.go b/main.go
index de3c96fa8..5f7fd27bc 100644
--- a/main.go
+++ b/main.go
@@ -2,12 +2,13 @@ package main
import (
"github.com/deluan/navidrome/conf"
+ "github.com/deluan/navidrome/consts"
"github.com/deluan/navidrome/db"
)
func main() {
if !conf.Server.DevDisableBanner {
- ShowBanner()
+ println(consts.Banner())
}
conf.Load()