Prefer larger files over shallow depth in findMainExe
Build & Deploy / build-and-deploy (push) Successful in 45s

Size is a better indicator of 'this is the actual game' than depth.
A 1MB+ FALLOUT.EXE in a subdirectory should beat a 50KB BOOTME.EXE
at the root. Sort order: non-installer → DOS → size → depth.
This commit is contained in:
Hermes Agent
2026-05-29 09:40:06 +02:00
parent dee37b3f01
commit 45d145a950
@@ -261,7 +261,7 @@ public class UploadResource {
if (candidates.isEmpty()) return null; if (candidates.isEmpty()) return null;
// Prefer: non-installer → DOS platform → shallow depth → larger file // Prefer: non-installer → DOS platform → larger file → shallow depth
candidates.sort(Comparator candidates.sort(Comparator
.comparingInt((Candidate c) -> c.isInstaller() ? 1 : 0) .comparingInt((Candidate c) -> c.isInstaller() ? 1 : 0)
.thenComparingInt(c -> { .thenComparingInt(c -> {
@@ -270,8 +270,8 @@ public class UploadResource {
if (c.platform() == null) return 1; if (c.platform() == null) return 1;
return 2; // "windows" return 2; // "windows"
}) })
.thenComparingInt(Candidate::depth) .thenComparingLong(c -> -c.size())
.thenComparingLong(c -> -c.size())); .thenComparingInt(Candidate::depth));
return candidates.getFirst().path(); return candidates.getFirst().path();
} }