From 5511006c1d96a98d77e668143706372f8e9e8f5f Mon Sep 17 00:00:00 2001 From: Joshua Taylor Date: Wed, 19 Apr 2023 10:52:41 -0500 Subject: [PATCH] Fix author parsing to use the actual object CurseForge added the id as part of the data now, so we don't need to parse it. This also broke my regex for it. And have 202's re-sync. --- syncproject.go | 9 +-------- web.go | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/syncproject.go b/syncproject.go index c0b87f3..9a7423a 100644 --- a/syncproject.go +++ b/syncproject.go @@ -136,17 +136,10 @@ func (consumer *SyncProjectConsumer) Consume(id uint, ctx context.Context) *widg newProps.Thumbnail = addon.Logo.ThumbnailUrl for _, v := range addon.Authors { - var authorId uint - - urls := authorIdRegex.FindStringSubmatch(v.Url) - if len(urls) < 2 { - authorId = v.Id - } - authorId = cast.ToUint(urls[1]) newProps.Members = append(newProps.Members, widget.ProjectMember{ Username: v.Name, Title: coalesce("Owner"), - Id: authorId, + Id: v.Id, }) } diff --git a/web.go b/web.go index a95fdbe..ece4e19 100644 --- a/web.go +++ b/web.go @@ -256,7 +256,7 @@ func handleResolveProject(c *gin.Context, path string) { } //resync project if older than X time - if project.UpdatedAt.Before(time.Now().Add(-1 * time.Hour)) { + if project.UpdatedAt.Before(time.Now().Add(-1*time.Hour)) || project.Status == http.StatusAccepted { temp := SyncProject(project.ID, ctx) if temp != nil { project = temp