Skip to content

Commit

Permalink
OV-349: * fix magic numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
stefano-lacorazza committed Sep 24, 2024
1 parent 5d9289a commit 62dcf10
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions frontend/src/bundles/studio/helpers/scenes-exceed-scripts.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import { type Scene, type Script } from '../types/types.js';

const INITIAL_DURATION = 0;

const scenesExceedScripts = (scenes: Scene[], scripts: Script[]): boolean => {
const totalScenesDuration = scenes.reduce(
(accumulator, scene) => accumulator + scene.duration,
0,
INITIAL_DURATION,
);
const totalScriptsDuration = scripts.reduce(
(accumulator, script) => accumulator + script.duration,
0,
INITIAL_DURATION,
);

return totalScenesDuration > totalScriptsDuration;
};

export { scenesExceedScripts };
export { scenesExceedScripts };

0 comments on commit 62dcf10

Please sign in to comment.