diff --git a/server_apps.go b/server_apps.go index a9d76f0dc8c60fb892ff1e83bdaf1c5e6929a2bc..65ba7ce08de9b555100917f8717a92f1fd2cf256 100644 --- a/server_apps.go +++ b/server_apps.go @@ -255,6 +255,7 @@ func (s *server) parseAppToml(ctx context.Context, pathInRepo string, obj *objec var data struct { App struct { Name string + Category string Menu string } Entry struct { @@ -276,13 +277,16 @@ func (s *server) parseAppToml(ctx context.Context, pathInRepo string, obj *objec if data.App.Name == "" || len(data.App.Name) > 32 { return nil, fmt.Errorf("app name invalid (must be non-empty and <= 32 chars)") } + if data.App.Category == "" { + data.App.Category = data.App.Menu + } sections := map[string]bool{ "Badge": true, "Apps": true, "Music": true, } - if !sections[data.App.Menu] { - return nil, fmt.Errorf("app menu invalid (must be one of 'Badge', 'Apps', 'Music')") + if !sections[data.App.Category] { + return nil, fmt.Errorf("app category invalid (must be one of 'Badge', 'Apps', 'Music')") } if data.Entry.Class == "" { return nil, fmt.Errorf("no entry class") @@ -297,7 +301,7 @@ func (s *server) parseAppToml(ctx context.Context, pathInRepo string, obj *objec return &appInfo{ name: data.App.Name, author: data.Metadata.Author, - menu: data.App.Menu, + menu: data.App.Category, description: data.Metadata.Description, version: data.Metadata.Version, commit: obj.Hash.String(),