mirror of
https://github.com/stashapp/stash.git
synced 2025-12-09 18:04:33 +01:00
Fix duplicate scene checker select logic (#4800)
This commit is contained in:
parent
141f60f8fb
commit
0bba8889b8
1 changed files with 4 additions and 4 deletions
|
|
@ -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) => {
|
||||
|
|
@ -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
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue