feat: add server name and version to all responses
This is inline with other Subsonic compatible servers, like funkwhale, madsonic, ampache...
This commit is contained in:
+2
-2
@@ -3,6 +3,8 @@ package consts
|
||||
import "time"
|
||||
|
||||
const (
|
||||
AppName = "navidrome"
|
||||
|
||||
LocalConfigFile = "./navidrome.toml"
|
||||
InitialSetupFlagKey = "InitialSetup"
|
||||
|
||||
@@ -10,7 +12,5 @@ const (
|
||||
JWTIssuer = "ND"
|
||||
JWTTokenExpiration = 30 * time.Minute
|
||||
|
||||
InitialUserName = "admin"
|
||||
|
||||
UIAssetsLocalPath = "ui/build"
|
||||
)
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package consts
|
||||
|
||||
import "fmt"
|
||||
|
||||
var (
|
||||
// This will be set in build time. If not, version will be set to "dev"
|
||||
gitTag string
|
||||
gitSha string
|
||||
)
|
||||
|
||||
// Formats:
|
||||
// dev
|
||||
// v0.2.0 (5b84188)
|
||||
// master (9ed35cb)
|
||||
func Version() string {
|
||||
if gitSha == "" {
|
||||
return "dev"
|
||||
}
|
||||
return fmt.Sprintf("%s (%s)", gitTag, gitSha)
|
||||
}
|
||||
Reference in New Issue
Block a user