navidrome/resources/banner.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
418 B
Go
Raw Permalink Normal View History

package resources
2020-01-25 11:06:04 -05:00
import (
"fmt"
2024-02-03 12:05:03 -05:00
"io"
2020-01-25 11:06:04 -05:00
"strings"
2020-03-18 23:21:01 -04:00
"unicode"
2020-01-25 11:06:04 -05:00
"github.com/navidrome/navidrome/consts"
2020-01-25 11:06:04 -05:00
)
2021-07-20 18:43:15 -04:00
func loadBanner() string {
2024-02-03 12:05:03 -05:00
f, err := embedFS.Open("banner.txt")
if err != nil {
return ""
}
data, _ := io.ReadAll(f)
2020-03-18 23:21:01 -04:00
return strings.TrimRightFunc(string(data), unicode.IsSpace)
2020-01-25 11:06:04 -05:00
}
func Banner() string {
2022-09-14 21:09:39 -04:00
version := "Version: " + consts.Version
2021-07-20 18:43:15 -04:00
return fmt.Sprintf("%s\n%52s\n", loadBanner(), version)
2020-01-25 11:06:04 -05:00
}