dont support macos
This commit is contained in:
parent
1853388ee6
commit
9b6c1eaf62
1 changed files with 5 additions and 15 deletions
20
src/main.ts
20
src/main.ts
|
@ -1,8 +1,8 @@
|
||||||
import { FileFilter, BrowserWindow, app, dialog, ipcMain } from "electron";
|
import { BrowserWindow, app, dialog, ipcMain } from "electron";
|
||||||
|
import { unlink } from "fs";
|
||||||
import path = require("path");
|
import path = require("path");
|
||||||
import ffmpegPath = require("ffmpeg-static");
|
import ffmpegPath = require("ffmpeg-static");
|
||||||
import child_process = require("child_process");
|
import child_process = require("child_process");
|
||||||
import { unlink } from "fs";
|
|
||||||
|
|
||||||
/** Create a new window */
|
/** Create a new window */
|
||||||
const createWindow = () => {
|
const createWindow = () => {
|
||||||
|
@ -23,8 +23,9 @@ const createWindow = () => {
|
||||||
const moviesFilter = {
|
const moviesFilter = {
|
||||||
name: "Videos",
|
name: "Videos",
|
||||||
extensions: ["mp4", "mkv"],
|
extensions: ["mp4", "mkv"],
|
||||||
} as FileFilter;
|
};
|
||||||
|
|
||||||
|
/* Create a new filename from the OG one */
|
||||||
const getNewFilename = (ogFile: string, part: string) => {
|
const getNewFilename = (ogFile: string, part: string) => {
|
||||||
const oldFile = path.parse(ogFile);
|
const oldFile = path.parse(ogFile);
|
||||||
return path.join(oldFile.dir, `${part}`.concat(oldFile.base));
|
return path.join(oldFile.dir, `${part}`.concat(oldFile.base));
|
||||||
|
@ -55,6 +56,7 @@ const mergeAudio = (file: string) => {
|
||||||
return outFile;
|
return outFile;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Ready to create the window */
|
||||||
app.whenReady().then(() => {
|
app.whenReady().then(() => {
|
||||||
const win = createWindow();
|
const win = createWindow();
|
||||||
|
|
||||||
|
@ -78,16 +80,4 @@ app.whenReady().then(() => {
|
||||||
ipcMain.handle("mergeAudio", (_, file: string) => mergeAudio(file));
|
ipcMain.handle("mergeAudio", (_, file: string) => mergeAudio(file));
|
||||||
ipcMain.handle("exit", async () => app.quit());
|
ipcMain.handle("exit", async () => app.quit());
|
||||||
ipcMain.handle("confirmation", async (_, text: string) => confirmation(text));
|
ipcMain.handle("confirmation", async (_, text: string) => confirmation(text));
|
||||||
|
|
||||||
app.on("activate", () => {
|
|
||||||
if (BrowserWindow.getAllWindows().length === 0) {
|
|
||||||
createWindow();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
app.on("window-all-closed", () => {
|
|
||||||
if (process.platform !== "darwin") {
|
|
||||||
app.quit();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue