Fixed images fetched not correct

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

2
dist

Submodule dist updated: 04d198136b...1e7d47d502

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}`
}