Prefer larger files over shallow depth in findMainExe
Build & Deploy / build-and-deploy (push) Successful in 45s
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:
@@ -261,7 +261,7 @@ public class UploadResource {
|
||||
|
||||
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
|
||||
.comparingInt((Candidate c) -> c.isInstaller() ? 1 : 0)
|
||||
.thenComparingInt(c -> {
|
||||
@@ -270,8 +270,8 @@ public class UploadResource {
|
||||
if (c.platform() == null) return 1;
|
||||
return 2; // "windows"
|
||||
})
|
||||
.thenComparingInt(Candidate::depth)
|
||||
.thenComparingLong(c -> -c.size()));
|
||||
.thenComparingLong(c -> -c.size())
|
||||
.thenComparingInt(Candidate::depth));
|
||||
|
||||
return candidates.getFirst().path();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user