✨ Improve file selection logic to prioritize largest files of each type
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user