|
|
|
|
@ -84,7 +84,7 @@ import {
|
|
|
|
|
import getSwal, { errorToast, showPlaybackFailedMessage } from './swal';
|
|
|
|
|
import { adjustRate } from './util/rate-calculator';
|
|
|
|
|
import { askExtractFramesAsImages } from './dialogs/extractFrames';
|
|
|
|
|
import type { CleanupChoicesType } from './dialogs';
|
|
|
|
|
import type { CleanupChoicesType, OpenFileResponse } from './dialogs';
|
|
|
|
|
import { askForOutDir, askForImportChapters, askForFileOpenAction, showDiskFull, showExportFailedDialog, showConcatFailedDialog, openYouTubeChaptersDialog, showRefuseToOverwrite, showOpenDialog, showMuxNotSupported, promptDownloadMediaUrl, showOutputNotWritable, deleteFiles, mustDisallowVob, toastError } from './dialogs';
|
|
|
|
|
import { openSendReportDialog } from './reporting';
|
|
|
|
|
import { sortSegments, convertSegmentsToChaptersWithGaps, hasAnySegmentOverlap, isDurationValid, getPlaybackAction, getSegmentTags, filterNonMarkers, isInitialSegment } from './segments';
|
|
|
|
|
@ -1843,11 +1843,12 @@ function App() {
|
|
|
|
|
if (isFileOpened) inputOptions.mergeWithCurrentFile = i18n.t('Merge/concatenate with current file');
|
|
|
|
|
if (batchFiles.length > 0 || newFilePaths.length > 1) inputOptions.addToBatch = i18n.t('Add the file to the batch list');
|
|
|
|
|
|
|
|
|
|
const inputOptionsKeys = Object.keys(inputOptions);
|
|
|
|
|
const inputOptionsKeys = Object.keys(inputOptions) as (keyof typeof inputOptions)[];
|
|
|
|
|
|
|
|
|
|
let openFileResponse: string | undefined;
|
|
|
|
|
let openFileResponse: OpenFileResponse | undefined;
|
|
|
|
|
if (inputOptionsKeys.length === 1) [openFileResponse] = inputOptionsKeys;
|
|
|
|
|
if (enableAskForFileOpenAction && inputOptionsKeys.length > 1) openFileResponse = await askForFileOpenAction(inputOptions);
|
|
|
|
|
if (!enableAskForFileOpenAction && inputOptionsKeys.length > 1) openFileResponse = 'addToBatch';
|
|
|
|
|
if (enableAskForFileOpenAction && inputOptionsKeys.length > 1) openFileResponse = await askForFileOpenAction(Object.entries(inputOptions) as [OpenFileResponse, string][]);
|
|
|
|
|
else if (newFilePaths.length === 1) openFileResponse = 'open';
|
|
|
|
|
|
|
|
|
|
if (openFileResponse === 'open') {
|
|
|
|
|
|