From 9b7bc5ce402d505dd6faf141182d86468c42e351 Mon Sep 17 00:00:00 2001 From: Maciej Pasternacki <maciej@3ofcoins.net> Date: Mon, 28 Aug 2023 16:44:56 +0200 Subject: [PATCH] Add commit timestamp to app list to allow sorting by most recent --- server_apps.go | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/server_apps.go b/server_apps.go index fbc1aac..f45be31 100644 --- a/server_apps.go +++ b/server_apps.go @@ -527,17 +527,18 @@ func (s *server) getAppRegistry(ctx context.Context) (*appRegistry, error) { } type jsonApp struct { - RepoURL string `json:"repoUrl"` - Commit string `json:"commit"` - DownloadURL string `json:"downloadUrl"` - TarDownloadURL string `json:"tarDownloadUrl"` - Name string `json:"name"` - Menu string `json:"menu"` - Author string `json:"author"` - Description string `json:"description"` - Version int `json:"version"` - Stars int `json:"stars"` - Flow3rSeed string `json:"flow3rSeed"` + RepoURL string `json:"repoUrl"` + Commit string `json:"commit"` + DownloadURL string `json:"downloadUrl"` + TarDownloadURL string `json:"tarDownloadUrl"` + Name string `json:"name"` + Menu string `json:"menu"` + Author string `json:"author"` + Description string `json:"description"` + Version int `json:"version"` + Timestamp time.Time `json:"timestamp"` + Stars int `json:"stars"` + Flow3rSeed string `json:"flow3rSeed"` } func makeJsonApp(a *appDescriptor) jsonApp { @@ -551,6 +552,7 @@ func makeJsonApp(a *appDescriptor) jsonApp { Author: a.appInfo.author, Description: a.appInfo.description, Version: a.appInfo.version, + Timestamp: a.appInfo.commitObj.Committer.When.UTC(), Stars: a.appInfo.stars, Flow3rSeed: a.appInfo.flow3rSeed, } -- GitLab