Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicate scene checker select logic #4800

Merged
merged 1 commit into from
May 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ export const SceneDuplicateChecker: React.FC = () => {
}

const findLargestScene = (group: GQL.SlimSceneDataFragment[]) => {
// Get total size of a scene
// Get maximum file size of a scene
const totalSize = (scene: GQL.SlimSceneDataFragment) => {
return scene.files.reduce((sum: number, f) => sum + (f.size || 0), 0);
return scene.files.reduce((prev: number, f) => Math.max(prev, f.size), 0);
};
// Find scene object with maximum total size
return group.reduce((largest, scene) => {
Expand All @@ -178,10 +178,10 @@ export const SceneDuplicateChecker: React.FC = () => {
};

const findLargestResolutionScene = (group: GQL.SlimSceneDataFragment[]) => {
// Get resolution of a scene
// Get maximum resolution of a scene
const sceneResolution = (scene: GQL.SlimSceneDataFragment) => {
return scene.files.reduce(
(sum: number, f) => sum + (f.height * f.width || 0),
(prev: number, f) => Math.max(prev, f.height * f.width),
0
);
};
Expand Down
Loading