Only compute version once
This commit is contained in:
@@ -212,7 +212,7 @@ func (b *broker) listen() {
|
||||
|
||||
// Send a serverStart event to new client
|
||||
msg := b.prepareMessage(context.Background(),
|
||||
&ServerStart{StartTime: consts.ServerStart, Version: consts.Version()})
|
||||
&ServerStart{StartTime: consts.ServerStart, Version: consts.Version})
|
||||
c.diode.put(msg)
|
||||
|
||||
case c := <-b.unsubscribing:
|
||||
|
||||
@@ -27,7 +27,7 @@ func serveIndex(ds model.DataStore, fs fs.FS) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
appConfig := map[string]interface{}{
|
||||
"version": consts.Version(),
|
||||
"version": consts.Version,
|
||||
"firstTime": firstTime,
|
||||
"variousArtistsId": consts.VariousArtistsID,
|
||||
"baseURL": utils.SanitizeText(strings.TrimSuffix(conf.Server.BaseURL, "/")),
|
||||
@@ -63,7 +63,7 @@ func serveIndex(ds model.DataStore, fs fs.FS) http.HandlerFunc {
|
||||
}
|
||||
|
||||
log.Debug("UI configuration", "appConfig", appConfig)
|
||||
version := consts.Version()
|
||||
version := consts.Version
|
||||
if version != "dev" {
|
||||
version = "v" + version
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ var _ = Describe("serveIndex", func() {
|
||||
serveIndex(ds, fs)(w, r)
|
||||
|
||||
config := extractAppConfig(w.Body.String())
|
||||
Expect(config).To(HaveKeyWithValue("version", consts.Version()))
|
||||
Expect(config).To(HaveKeyWithValue("version", consts.Version))
|
||||
})
|
||||
|
||||
It("sets the losslessFormats", func() {
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
)
|
||||
|
||||
func newResponse() *responses.Subsonic {
|
||||
return &responses.Subsonic{Status: "ok", Version: Version, Type: consts.AppName, ServerVersion: consts.Version()}
|
||||
return &responses.Subsonic{Status: "ok", Version: Version, Type: consts.AppName, ServerVersion: consts.Version}
|
||||
}
|
||||
|
||||
func requiredParamString(r *http.Request, param string) (string, error) {
|
||||
|
||||
Reference in New Issue
Block a user