Updated some logic.

This commit is contained in:
LevelX2 2017-09-06 17:49:55 +02:00
parent 7329dc6c3f
commit c9327b718d
3 changed files with 1877 additions and 1590 deletions

View file

@ -36,4 +36,12 @@ public interface CardImageSource {
default ArrayList<String> getSupportedSets() { default ArrayList<String> getSupportedSets() {
return null; return null;
} }
default boolean isSetSupportedComplete(String setCode) {
return true;
}
default boolean isImageProvided(String setCode, String cardName) {
return false;
}
} }

View file

@ -294,7 +294,9 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab
for (CardDownloadData data : allCardsMissingImage) { for (CardDownloadData data : allCardsMissingImage) {
if ((data.isToken() && tokens) if ((data.isToken() && tokens)
|| (!data.isToken() && selectedSetCodes != null && selectedSetCodes.contains(data.getSet()))) { || (!data.isToken() && selectedSetCodes != null && selectedSetCodes.contains(data.getSet()))) {
cardsToDownload.add(data); if (cardImageSource.isSetSupportedComplete(data.getSet()) || cardImageSource.isImageProvided(data.getSet(), data.getName())) {
cardsToDownload.add(data);
}
} }
} }
int numberTokenImagesAvailable = 0; int numberTokenImagesAvailable = 0;