|
|
|
@ -1110,15 +1110,21 @@ const App = memo(() => {
|
|
|
|
return getOutPath(cod, fp, `html5ified-${type}.${ext}`);
|
|
|
|
return getOutPath(cod, fp, `html5ified-${type}.${ext}`);
|
|
|
|
}, []);
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const resetCutSegments = useCallback((edl) => {
|
|
|
|
|
|
|
|
cutSegmentsHistory.go(0);
|
|
|
|
|
|
|
|
setCutSegments(edl);
|
|
|
|
|
|
|
|
}, [cutSegmentsHistory, setCutSegments]);
|
|
|
|
|
|
|
|
|
|
|
|
const loadCutSegments = useCallback((edl) => {
|
|
|
|
const loadCutSegments = useCallback((edl) => {
|
|
|
|
if (edl.length === 0) throw new Error();
|
|
|
|
const validEdl = edl.filter((row) => (
|
|
|
|
const allRowsValid = edl.every(row => row.start === undefined || row.end === undefined || row.start < row.end);
|
|
|
|
(row.start === undefined || row.end === undefined || row.start < row.end)
|
|
|
|
|
|
|
|
&& (row.start === undefined || row.start >= 0)
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
|
|
if (!allRowsValid) throw new Error(i18n.t('Invalid start or end values for one or more segments'));
|
|
|
|
if (validEdl.length === 0) throw new Error(i18n.t('No valid segments found'));
|
|
|
|
|
|
|
|
|
|
|
|
cutSegmentsHistory.go(0);
|
|
|
|
resetCutSegments(validEdl.map(createSegment));
|
|
|
|
setCutSegments(edl.map(createSegment));
|
|
|
|
}, [resetCutSegments]);
|
|
|
|
}, [cutSegmentsHistory, setCutSegments]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const loadEdlFile = useCallback(async (path, type = 'csv') => {
|
|
|
|
const loadEdlFile = useCallback(async (path, type = 'csv') => {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|