* Images: fixed wrong token filter and stats in images download dialog (#8443);

This commit is contained in:
Oleg Agafonov 2021-11-27 23:09:11 +04:00
parent 697beedb7d
commit 903a9215cc

View file

@ -314,6 +314,7 @@ public class DownloadPicturesService extends DefaultBoundedRangeModel implements
private void reloadCardsToDownload(String selectedItem) { private void reloadCardsToDownload(String selectedItem) {
// find selected sets // find selected sets
selectedSets.clear(); selectedSets.clear();
boolean onlyTokens = false;
List<String> formatSets; List<String> formatSets;
List<String> sourceSets = selectedSource.getSupportedSets(); List<String> sourceSets = selectedSource.getSupportedSets();
switch (selectedItem) { switch (selectedItem) {
@ -337,6 +338,8 @@ public class DownloadPicturesService extends DefaultBoundedRangeModel implements
break; break;
case ALL_TOKENS: case ALL_TOKENS:
selectedSets.addAll(selectedSource.getSupportedSets());
onlyTokens = true;
break; break;
default: default:
@ -355,12 +358,14 @@ public class DownloadPicturesService extends DefaultBoundedRangeModel implements
for (CardDownloadData data : cardsMissing) { for (CardDownloadData data : cardsMissing) {
if (data.isToken()) { if (data.isToken()) {
if (selectedSource.isTokenSource() if (selectedSource.isTokenSource()
&& selectedSource.isTokenImageProvided(data.getSet(), data.getName(), data.getType())) { && selectedSource.isTokenImageProvided(data.getSet(), data.getName(), data.getType())
&& selectedSets.contains(data.getSet())) {
numberTokenImagesAvailable++; numberTokenImagesAvailable++;
cardsDownloadQueue.add(data); cardsDownloadQueue.add(data);
} }
} else { } else {
if (selectedSource.isCardSource() if (!onlyTokens
&& selectedSource.isCardSource()
&& selectedSource.isCardImageProvided(data.getSet(), data.getName()) && selectedSource.isCardImageProvided(data.getSet(), data.getName())
&& selectedSets.contains(data.getSet())) { && selectedSets.contains(data.getSet())) {
numberCardImagesAvailable++; numberCardImagesAvailable++;