diff --git a/src/main/java/me/itzg/helpers/curseforge/CurseForgeFilesCommand.java b/src/main/java/me/itzg/helpers/curseforge/CurseForgeFilesCommand.java index d8500fc7..059f6986 100644 --- a/src/main/java/me/itzg/helpers/curseforge/CurseForgeFilesCommand.java +++ b/src/main/java/me/itzg/helpers/curseforge/CurseForgeFilesCommand.java @@ -199,7 +199,12 @@ private static Map buildPreviousFilesFromManifest(CurseFo oldManifest.getEntries().stream() .collect(Collectors.toMap( FileEntry::getIds, - fileEntry -> fileEntry + fileEntry -> fileEntry, + // merge by picking first + (t, t2) -> { + log.warn("Duplicate files detected in previous manifest: {} vs {}", t, t2); + return t; + } )) : Collections.emptyMap(); } diff --git a/src/main/java/me/itzg/helpers/curseforge/ModFileRefResolver.java b/src/main/java/me/itzg/helpers/curseforge/ModFileRefResolver.java index 71900d8d..89804c9c 100644 --- a/src/main/java/me/itzg/helpers/curseforge/ModFileRefResolver.java +++ b/src/main/java/me/itzg/helpers/curseforge/ModFileRefResolver.java @@ -66,6 +66,7 @@ public Mono> resolveModFiles(List modFileRefs, Stri @NotNull private static Flux expandFileListings(List modFileRefs) { return Flux.fromStream(modFileRefs.stream() + .distinct() // handle @-file containing refs .flatMap(ref -> { if (ref.startsWith("@")) { diff --git a/src/main/java/me/itzg/helpers/files/Manifests.java b/src/main/java/me/itzg/helpers/files/Manifests.java index 9d0fa8bb..31a9e9c2 100644 --- a/src/main/java/me/itzg/helpers/files/Manifests.java +++ b/src/main/java/me/itzg/helpers/files/Manifests.java @@ -144,7 +144,7 @@ public static M load(Path outputDir, String id, Class