From 580479ad82d1f959c826b0a5c431a14f22d1d4eb Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Wed, 14 Oct 2020 20:01:48 -0500 Subject: [PATCH] Revert "track qualified maps" This reverts commit f002e7c6fba0a3736cf9cb667ad0060efd1976df. --- scrape/scrape.go | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/scrape/scrape.go b/scrape/scrape.go index eab2671..a1cbafe 100644 --- a/scrape/scrape.go +++ b/scrape/scrape.go @@ -34,8 +34,6 @@ func RunScraper(config *config.Config, bot *discord.Bot, db *db.Db, api *osuapi. } allNewMaps := make(map[int][]osuapi.Beatmapset, 0) - - // add pending maps var newLastUpdateTime = time.Unix(0, 0) for _, beatmapSet := range pendingSets.Beatmapsets { updatedTime, err := time.Parse(time.RFC3339, beatmapSet.LastUpdated) @@ -62,35 +60,6 @@ func RunScraper(config *config.Config, bot *discord.Bot, db *db.Db, api *osuapi. } } - // add qualified maps - qualifiedSets, err := api.SearchBeatmaps("qualified") - if err != nil { - log.Println("error fetching pending sets", err) - } - - for _, beatmapSet := range qualifiedSets.Beatmapsets { - updatedTime, err := time.Parse(time.RFC3339, beatmapSet.LastUpdated) - if err != nil { - log.Println("error parsing last updated time", updatedTime) - } - - if updatedTime.After(newLastUpdateTime) { - // update lastUpdateTime to latest updated map - newLastUpdateTime = updatedTime - } - - if !updatedTime.After(lastUpdateTime) { - break - } - - mapperId := beatmapSet.UserID - if _, ok2 := allNewMaps[mapperId]; !ok2 { - allNewMaps[mapperId] = make([]osuapi.Beatmapset, 0) - } - - allNewMaps[mapperId] = append(allNewMaps[mapperId], beatmapSet) - } - if len(allNewMaps) > 0 { for mapperId, newMaps := range allNewMaps { channels := make([]string, 0)