mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-05 17:58:37 +01:00
23 lines
602 B
Go
23 lines
602 B
Go
package apiv1
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/navidrome/navidrome/api"
|
|
"github.com/navidrome/navidrome/consts"
|
|
)
|
|
|
|
func (rt *Router) GetServerInfo(ctx context.Context, _ GetServerInfoRequestObject) (GetServerInfoResponseObject, error) {
|
|
count, err := rt.ds.User().CountAll(ctx)
|
|
if err != nil {
|
|
return nil, fmt.Errorf("counting users: %w", err)
|
|
}
|
|
return GetServerInfo200JSONResponse{
|
|
Name: "Navidrome",
|
|
ServerVersion: consts.Version,
|
|
SpecVersion: api.SpecVersion(),
|
|
SetupRequired: count == 0,
|
|
LoginMethods: LoginMethods{Password: &PasswordLoginMethod{}},
|
|
}, nil
|
|
}
|