switch: Added platform name as constant

This commit is contained in:
Felipe M 2021-01-05 23:17:47 +01:00
parent f5991dfd21
commit ffa6db5c28
1 changed files with 2 additions and 1 deletions

View File

@ -14,6 +14,7 @@ import (
)
const providerName = "nintendo-switch"
const platformName = "Nintendo Switch"
const gameListURL = "https://fmartingr.github.io/switch-games-json/switch_id_names.json"
type SwitchGame struct {
@ -68,7 +69,7 @@ func addScreenshotToGame(userGames []games.Game, switchGame SwitchGame, screensh
}
if foundGame.ID == "" {
foundGame := games.Game{Name: switchGame.Name, ID: switchGame.EncryptedGameID, Platform: "Nintendo Switch", Provider: providerName}
foundGame := games.Game{Name: switchGame.Name, ID: switchGame.EncryptedGameID, Platform: platformName, Provider: providerName}
foundGame.Screenshots = append(foundGame.Screenshots, screenshot)
userGames = append(userGames, foundGame)
}