Skip to content

Commit

Permalink
make validate / make fmt-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
yer committed Nov 15, 2023
1 parent b8cf263 commit 1edf3e7
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ export const SceneDuplicateChecker: React.FC = () => {
const findLargestResolutionScene = (group: GQL.SlimSceneDataFragment[]) => {
// Get resolution of a scene
const sceneResolution = (scene: GQL.SlimSceneDataFragment) => {
return scene.files.reduce((sum: number, f) => sum + (f.height * f.width|| 0), 0);
return scene.files.reduce(
(sum: number, f) => sum + (f.height * f.width || 0),
0
);
};
// Find scene object with maximum resolution
return group.reduce((largest, scene) => {
Expand All @@ -190,7 +193,6 @@ export const SceneDuplicateChecker: React.FC = () => {
});
};


// Helper to get file date

const findFirstFileByAge = (
Expand Down Expand Up @@ -231,7 +233,9 @@ export const SceneDuplicateChecker: React.FC = () => {
}

function checkSameResolution(dataGroup: GQL.SlimSceneDataFragment[]) {
const resolutions = dataGroup.map((s) => s.files[0]?.width * s.files[0]?.height);
const resolutions = dataGroup.map(
(s) => s.files[0]?.width * s.files[0]?.height
);
return new Set(resolutions).size === 1;
}

Expand All @@ -255,7 +259,6 @@ export const SceneDuplicateChecker: React.FC = () => {
setCheckedScenes(checkedArray);
};


const onSelectLargestResolutionClick = () => {
setSelectedScenes([]);
const checkedArray: Record<string, boolean> = {};
Expand Down Expand Up @@ -759,7 +762,9 @@ export const SceneDuplicateChecker: React.FC = () => {
{intl.formatMessage({ id: "dupe_check.select_none" })}
</Dropdown.Item>

<Dropdown.Item onClick={() => onSelectLargestResolutionClick()}>
<Dropdown.Item
onClick={() => onSelectLargestResolutionClick()}
>
{intl.formatMessage({
id: "dupe_check.select_all_but_largest_resolution",
})}
Expand Down

0 comments on commit 1edf3e7

Please sign in to comment.