feat(ui): improve duplicate checker select options and fix resolution check

Renamed the dropdown options in the duplicate checkers to be much clearer about their behavior (e.g. 'Keep the largest file').
Also fixed a bug in the Image Duplicate Checker where 'select highest resolution' would fail or do nothing because 'checkSameResolution' was incorrectly trying to access array index [0] on visual_files instead of finding the max resolution across all files, causing it to incorrectly abort the selection.
This commit is contained in:
notsafeforgit 2026-03-23 01:40:43 -07:00
parent b61bb58405
commit 374d94932b
2 changed files with 10 additions and 7 deletions

View file

@ -250,9 +250,12 @@ const ImageDuplicateChecker: React.FC = () => {
};
function checkSameResolution(dataGroup: GQL.SlimImageDataFragment[]) {
const resolutions = dataGroup.map(
(s) => (s.visual_files[0]?.width ?? 0) * (s.visual_files[0]?.height ?? 0)
);
const resolutions = dataGroup.map((s) => {
return s.visual_files.reduce(
(prev, f) => Math.max(prev, (f.height ?? 0) * (f.width ?? 0)),
0
);
});
return new Set(resolutions).size === 1;
}

View file

@ -1136,12 +1136,12 @@
"medium": "Medium"
},
"search_accuracy_label": "Search Accuracy",
"select_all_but_largest_file": "Select every file in each duplicated group, except the largest file",
"select_all_but_largest_resolution": "Select every file in each duplicated group, except the file with highest resolution",
"select_all_but_largest_file": "Keep the largest file (select all but the largest)",
"select_all_but_largest_resolution": "Keep the highest resolution file (select all but the highest resolution)",
"select_none": "Select None",
"select_oldest": "Select the oldest file in the duplicate group",
"select_oldest": "Keep the oldest file (select all but the oldest)",
"select_options": "Select Options…",
"select_youngest": "Select the youngest file in the duplicate group",
"select_youngest": "Keep the youngest file (select all but the youngest)",
"title": "Duplicate Scenes"
},
"duplicated": "Duplicated",