This commit is contained in:
Izuco 2022-03-05 19:01:04 +01:00
parent 9ef4d43674
commit 6122a3eaa0
No known key found for this signature in database
GPG key ID: E9CBE9E4EF3A1BFA
4 changed files with 4 additions and 6 deletions

View file

@ -76,7 +76,7 @@ if (!process.env.TEST) {
fs.mkdirSync(logFolder);
if (fs.existsSync(path.join(logFolder, 'latest.log')))
fs.renameSync(path.join(logFolder, 'latest.log'), path.join(logFolder, `${Date.now()}.log`));
return new Console(fs.createWriteStream(path.join(logFolder, `latest.log`)));
return new Console(fs.createWriteStream(path.join(logFolder, 'latest.log')));
})();
}

View file

@ -18,7 +18,7 @@ export default (window: BrowserWindow) => {
return ev.returnValue = false;
handler = undefined;
ev.returnValue = true;
})
});
ipcMain.handle('type', async () => handler === undefined ? undefined : handler instanceof Funimation ? 'funi' : 'crunchy');
ipcMain.handle('auth', async (_, data) => handler?.auth(data));

View file

@ -29,7 +29,7 @@ export default class Base {
makeProgressHandler(videoInfo: DownloadInfo) {
return ((data: ProgressData) => {
const progress = (typeof data.percent === 'string' ?
parseFloat(data.percent) : data.percent) / 100;
parseFloat(data.percent) : data.percent) / 100;
this.window.setProgressBar(progress === 1 ? -1 : progress);
this.sendMessage({
name: 'progress',

View file

@ -1,10 +1,8 @@
import * as path from 'path';
import * as fs from 'fs';
import { ArgvType } from './module.app-args';
import { workingDir } from './module.cfg-loader';
const workingDir = (process as NodeJS.Process & {
pkg?: unknown
}).pkg ? path.dirname(process.execPath) : path.join(__dirname, '/..');
export const archiveFile = path.join(workingDir, 'config', 'archive.json');
export type ItemType = {