This commit is contained in:
2025-04-05 02:42:09 +11:00
parent d570005d1c
commit 18dc9781b1
82 changed files with 3412 additions and 254 deletions

View File

@@ -5,21 +5,21 @@ import (
)
func (g *igdb) GetParentGameID(id uint64) (uint64, error) {
detail, err := g.GetGame(id)
detail, err := g.GetGameByID(id)
if err != nil {
return 0, fmt.Errorf("failed to fetch IGDB app detail for parent: %d: %w", id, err)
}
hasParent := false
if detail.ParentGame != nil && detail.ParentGame.Id != 0 {
hasParent = true
detail, err = g.GetGame(detail.ParentGame.Id)
detail, err = g.GetGameByID(detail.ParentGame.Id)
if err != nil {
return 0, fmt.Errorf("failed to fetch IGDB version parent: %d: %w", detail.VersionParent.Id, err)
}
}
for detail.VersionParent != nil && detail.VersionParent.Id != 0 {
hasParent = true
detail, err = g.GetGame(detail.VersionParent.Id)
detail, err = g.GetGameByID(detail.VersionParent.Id)
if err != nil {
return 0, fmt.Errorf("failed to fetch IGDB version parent: %d: %w", detail.VersionParent.Id, err)
}