Fixed images fetched not correct

Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
Florian Bouillon 2021-04-18 02:04:28 +02:00
parent 8d19e46c2c
commit 40206cb4ee
Signed by: Florian Bouillon
GPG Key ID: 50BD648F12C86AB6
2 changed files with 2 additions and 2 deletions

2
dist

@ -1 +1 @@
Subproject commit 04d198136bf93109442bee82f0b3abf038d9f4c8
Subproject commit 1e7d47d502f84849ac8aa9f9e689cc83252f6b95

View File

@ -25,7 +25,7 @@ export async function cardToCardSimple(id: string, card: Card, lang: SupportedLa
export async function getCardPictures(cardId: string, card: Card, lang: SupportedLanguages): Promise<string | undefined> {
try {
const file = await fetchRemoteFile(`https://assets.tcgdex.net/datas.json`)
const fileExists = !!file[lang]?.[card.set.serie.code]?.[card.set.code]?.[card.localId]
const fileExists = !!file[lang]?.[card.set.serie.id]?.[card.set.id]?.[cardId]
if (fileExists) {
return `https://assets.tcgdex.net/${lang}/${card.set.serie.id}/${card.set.id}/${cardId}`
}