mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -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),
|
||||
cn,
|
||||
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),
|
||||
cn);
|
||||
// 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)
|
||||
// bug: https://github.com/magefree/mage/issues/6829
|
||||
// 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
|
||||
// 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");
|
||||
return new CardImageUrls(baseUrl, alternativeUrl );
|
||||
}
|
||||
|
||||
private String getFaceImageUrl(Proxy proxy, CardDownloadData card, boolean isToken) throws Exception {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue