Simplify resources code, enabling any resource to be overridden (not just translations)

This commit is contained in:
Deluan 2021-10-28 10:25:25 -04:00
parent 9072412812
commit fa3471f527
6 changed files with 30 additions and 20 deletions

19
resources/banner.go Normal file
View file

@ -0,0 +1,19 @@
package resources
import (
"fmt"
"strings"
"unicode"
"github.com/navidrome/navidrome/consts"
)
func loadBanner() string {
data, _ := Asset("banner.txt")
return strings.TrimRightFunc(string(data), unicode.IsSpace)
}
func Banner() string {
version := "Version: " + consts.Version()
return fmt.Sprintf("%s\n%52s\n", loadBanner(), version)
}