mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 18:50:06 -08:00
images: removed redundant download links for scryfall cards (#12508)
Found the include_variations flag so no need for a third search to check for variations - combined it with the second search (that drops the language code).
This commit is contained in:
parent
aa29803629
commit
0a23521ece
1 changed files with 5 additions and 5 deletions
|
|
@ -122,20 +122,20 @@ public class ScryfallImageSource implements CardImageSource {
|
||||||
formatSetName(card.getSet(), isToken),
|
formatSetName(card.getSet(), isToken),
|
||||||
cn,
|
cn,
|
||||||
localizedCode);
|
localizedCode);
|
||||||
alternativeUrl = String.format("https://api.scryfall.com/cards/%s/%s?format=image",
|
alternativeUrl = String.format("https://api.scryfall.com/cards/%s/%s?format=image&include_variations=true",
|
||||||
formatSetName(card.getSet(), isToken),
|
formatSetName(card.getSet(), isToken),
|
||||||
cn);
|
cn);
|
||||||
// with no localisation code, scryfall defaults to first available image - usually english, but may not be for some special cards
|
// with no localisation code, scryfall defaults to first available image - usually english, but may not be for some special cards
|
||||||
// workaround to use cards without english images (some promos or special cards)
|
// workaround to use cards without english images (some promos or special cards)
|
||||||
// bug: https://github.com/magefree/mage/issues/6829
|
// bug: https://github.com/magefree/mage/issues/6829
|
||||||
// example: Mysterious Egg from IKO https://api.scryfall.com/cards/iko/385/?format=image
|
// example: Mysterious Egg from IKO https://api.scryfall.com/cards/iko/385/?format=image
|
||||||
|
// include_variations=true added to deal with the cards that scryfall has marked as variations that seem to sometimes fail
|
||||||
|
// eg https://api.scryfall.com/cards/4ed/134†?format=image fails
|
||||||
|
// eg https://api.scryfall.com/cards/4ed/134†?format=image&include_variations=true succeeds
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// workaround to deal with the cards that scryfall has marked as variations that seem to sometimes fail
|
return new CardImageUrls(baseUrl, alternativeUrl );
|
||||||
// eg https://api.scryfall.com/cards/4ed/134†?format=image fails
|
|
||||||
// eg https://api.scryfall.com/cards/4ed/134†?format=image&variation=true succeeds
|
|
||||||
return new CardImageUrls(baseUrl, alternativeUrl , alternativeUrl + "&variation=true");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getFaceImageUrl(Proxy proxy, CardDownloadData card, boolean isToken) throws Exception {
|
private String getFaceImageUrl(Proxy proxy, CardDownloadData card, boolean isToken) throws Exception {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue