Improve file selection logic to prioritize largest files of each type

This commit is contained in:
2026-01-28 20:28:04 +00:00
parent 1b9a1d9386
commit 765742c6c7

View File

@@ -411,17 +411,17 @@ const highlightConfig = computed(() => ({
// Get unique files by type (only show one of each file type, prefer largest)
const uniqueFiles = computed(() => {
const fileMap = new Map();
status.value.available?.forEach(file => {
const fileType = getFileType(file.filename);
const existing = fileMap.get(fileType);
// Keep the largest file of each type
if (!existing || file.size > existing.size) {
fileMap.set(fileType, file);
}
});
// Return files in consistent order
return Array.from(fileMap.values()).sort((a, b) => {
const order = { pokemon: 0, allForms: 1, moves: 2, raw: 3 };