Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion handlers/getStatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

var initTime = time.Now()
var version = "1.18.3"
var version = "1.18.4"

func getStatus(w http.ResponseWriter, r *http.Request) {
json.NewEncoder(w).Encode(map[string]interface{}{
Expand Down
11 changes: 11 additions & 0 deletions scraper/scrapeGuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package scraper

import (
"net/http"
"slices"
"strconv"
"strings"

Expand Down Expand Up @@ -63,5 +64,15 @@ func scrapeGuild(body *colly.HTMLElement, region, guildName string) {
guildProfile.Members = append(guildProfile.Members, member)
})

// Link to master's profile at the top of the page has a different profile target than the one
// in the members list, so replacing it with the one from the members list helps with consistency and cache hits
if guildProfile.Master != nil {
if i := slices.IndexFunc(guildProfile.Members, func(m models.Profile) bool {
return m.FamilyName == guildProfile.Master.FamilyName
}); i != -1 {
guildProfile.Master.ProfileTarget = guildProfile.Members[i].ProfileTarget
}
}

cache.GuildProfiles.AddRecord([]string{region, guildName}, guildProfile, status, body.Request.Ctx.Get("taskId"))
}