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
3 changes: 2 additions & 1 deletion full-games-clz-list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64313,4 +64313,5 @@
<shoulduploadfrontcover boolvalue="True">Yes</shoulduploadfrontcover>
<shoulduploadbackcover boolvalue="True">Yes</shoulduploadbackcover>
</game>
</gamelist>
</gamelist>
</gameinfo>
6 changes: 4 additions & 2 deletions src/adapters/igdb/igdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func fuzzyFindIGDBGameByTitle(title string, clzPlatformName string) int {
// Search for the game by normalized title
gamesData := fuzzySearchByTerm(normalizedTitle)
if len(gamesData) == 0 {
fmt.Printf("No games found in FuzzyFind for title: %s\n", title)
fmt.Printf("FuzzyFind failed for title: %s\n", normalizedTitle)
return 0
}

Expand Down Expand Up @@ -146,10 +146,12 @@ func fuzzyFindGamesList(gameList []domain.Game) []domain.Game {
fmt.Printf("Invalid IGDB_API_RATE_LIMIT value: %v -- setting to 0\n", err)
rateLimit = 0 // Default to 0 second if parsing fails
}
sleepTime := time.Duration(rateLimit)

sleepTime := time.Duration(rateLimit) * time.Millisecond

for i, game := range gameList {
if i != 0 {
fmt.Printf("%d Sleeping for rate limit...\n", i)
// Sleep for a short duration to avoid hitting the rate limit
time.Sleep(sleepTime)
}
Expand Down
4 changes: 2 additions & 2 deletions src/domain/clz-translation/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ func TranslateCLZ(input string, igdbSupplement bool) domain.GameCollection {
rateLimit, err := strconv.Atoi(rateLimitStr)
if err != nil {
fmt.Printf("Invalid IGDB_API_RATE_LIMIT value: %v\n", err)
rateLimit = 2000 // Default to 2000 second if parsing fails
rateLimit = 500 // default to 500 milliseconds if parsing fails
}
sleepTime := time.Duration(rateLimit)
sleepTime := time.Duration(rateLimit) * time.Millisecond

for _, batchQuery := range batchQueries {
// retrieve IGDB data for each batch
Expand Down