diff --git a/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformReleases.java b/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformReleases.java index fc516512d..2cdeb5c27 100644 --- a/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformReleases.java +++ b/app/src/cc/arduino/contributions/packages/ui/ContributedPlatformReleases.java @@ -61,6 +61,12 @@ public class ContributedPlatformReleases { return platform.getArchitecture().equals(arch); } + public boolean contains(ContributedPlatform platform) { + return (platform.getParentPackage().equals(packager) + && platform.getArchitecture().equals(arch) + && versions.contains(platform.getParsedVersion())); + } + public void add(ContributedPlatform platform) { releases.add(platform); String version = platform.getParsedVersion(); diff --git a/app/src/cc/arduino/contributions/packages/ui/ContributionIndexTableModel.java b/app/src/cc/arduino/contributions/packages/ui/ContributionIndexTableModel.java index f7dbd95d7..4a9b89bb3 100644 --- a/app/src/cc/arduino/contributions/packages/ui/ContributionIndexTableModel.java +++ b/app/src/cc/arduino/contributions/packages/ui/ContributionIndexTableModel.java @@ -66,11 +66,21 @@ public class ContributionIndexTableModel + platform.getBoards().stream() .map(ContributedBoard::getName) .collect(Collectors.joining(" ")); + + // Add all the versions of the same core, even if there's no match + for (ContributedPlatformReleases contribution : contributions) { + if (contribution.shouldContain(platform)) { + addContribution(platform); + continue; + } + } + if (!filter.test(platform)) { continue; } if (!stringContainsAll(compoundTargetSearchText, filters)) continue; + addContribution(platform); } } @@ -110,12 +120,16 @@ public class ContributionIndexTableModel private void addContribution(ContributedPlatform platform) { for (ContributedPlatformReleases contribution : contributions) { - if (!contribution.shouldContain(platform)) + if (!contribution.shouldContain(platform)) { continue; + } + if (contribution.contains(platform)) { + // no duplicates + return; + } contribution.add(platform); return; } - contributions.add(new ContributedPlatformReleases(platform)); }