The swiss army knife of lossless video/audio editing
add out of space dialog #328
Mikael Finstadb9bde3b2bbfa
diff --git a/src/App.jsx b/src/App.jsxindex aa3eafd8..18863294 100644--- a/src/App.jsx+++ b/src/App.jsx@@ -50,7 +50,7 @@ import {checkDirWriteAccess, dirExists, openDirToast, isMasBuild, isStoreBuild, dragPreventer, doesPlayerSupportFile,isDurationValid, isWindows,} from './util';-import { askForOutDir, askForImportChapters, createNumSegments, createFixedDurationSegments, promptTimeOffset, askForHtml5ifySpeed, askForYouTubeInput, askForFileOpenAction, confirmExtractAllStreamsDialog, cleanupFilesDialog } from './dialogs';+import { askForOutDir, askForImportChapters, createNumSegments, createFixedDurationSegments, promptTimeOffset, askForHtml5ifySpeed, askForYouTubeInput, askForFileOpenAction, confirmExtractAllStreamsDialog, cleanupFilesDialog, showDiskFull } from './dialogs';import { openSendReportDialog } from './reporting';import { fallbackLng } from './i18n';import { createSegment, createInitialCutSegments, getCleanCutSegments, getSegApparentStart, findSegmentsAtCursor } from './segments';@@ -1101,6 +1101,11 @@ const App = memo(() => {console.error('stderr:', err.stderr);if (err.exitCode === 1 || err.code === 'ENOENT') {+ // A bit hacky but it works, unless someone has a file called "No space left on device" ( ͡° ͜ʖ ͡°)+ if (typeof err.stderr === 'string' && err.stderr.includes('No space left on device')) {+ showDiskFull();+ return;+ }handleCutFailed(err);return;}diff --git a/src/dialogs.js b/src/dialogs.jsindex 0cb65825..2c58f53f 100644--- a/src/dialogs.js+++ b/src/dialogs.js@@ -108,6 +108,13 @@ export async function askForFileOpenAction() {return value;}+export async function showDiskFull() {+ await Swal.fire({+ icon: 'error',+ text: i18n.t('You ran out of space'),+ });+}+export async function askForImportChapters() {const { value } = await Swal.fire({icon: 'question',