Dependencies cleanup (#1736)

* Remove unused electron-builder-squirrel-windows

* filesize upgrade
This commit is contained in:
Salah Benmoussati 2023-03-21 09:50:10 +01:00 committed by GitHub
parent 6130805e32
commit 6f9239e577
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 1035 deletions

1041
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -176,7 +176,6 @@
"del": "3.0.0", "del": "3.0.0",
"electron": "^23.1.0", "electron": "^23.1.0",
"electron-builder": "24.0.0", "electron-builder": "24.0.0",
"electron-builder-squirrel-windows": "20.44.0",
"electron-icon-maker": "0.0.5", "electron-icon-maker": "0.0.5",
"electron-osx-sign": "^0.6.0", "electron-osx-sign": "^0.6.0",
"enzyme": "^3.11.0", "enzyme": "^3.11.0",
@ -216,7 +215,7 @@
"electron-fetch": "1.9.1", "electron-fetch": "1.9.1",
"electron-log": "4.4.8", "electron-log": "4.4.8",
"electron-updater": "^5.0.1", "electron-updater": "^5.0.1",
"filesize": "6.4.0", "filesize": "^10.0.6",
"lazy-brush": "^1.0.1", "lazy-brush": "^1.0.1",
"react": "16.14.0", "react": "16.14.0",
"react-dom": "16.14.0", "react-dom": "16.14.0",
@ -246,4 +245,4 @@
"pre-commit": "pretty-quick --staged && npm run lint" "pre-commit": "pretty-quick --staged && npm run lint"
} }
} }
} }

View File

@ -14,7 +14,7 @@ import {
} from 'electron'; } from 'electron';
import electron = require('electron'); import electron = require('electron');
import fetch from 'electron-fetch'; import fetch from 'electron-fetch';
import * as filesize from 'filesize'; import { filesize } from 'filesize';
import * as fs from 'fs'; import * as fs from 'fs';
import * as path from 'path'; import * as path from 'path';
import { format, parse } from 'url'; import { format, parse } from 'url';
@ -607,10 +607,13 @@ export const handleDownloadManager = (
item.once('done', (_e, state) => { item.once('done', (_e, state) => {
if (state === 'completed') { if (state === 'completed') {
const savePathSplit = item.getSavePath()?.split(path.sep); const savePathSplit = item.getSavePath()?.split(path.sep);
const downloadedItemTotalBytes: number = item.getTotalBytes() || 0;
const data: IDownloadItem = { const data: IDownloadItem = {
_id: getGuid(), _id: getGuid(),
savedPath: item.getSavePath() || '', savedPath: item.getSavePath() || '',
total: filesize(item.getTotalBytes() || 0), total: filesize(downloadedItemTotalBytes, {
output: 'string',
}) as string,
fileName: savePathSplit[savePathSplit.length - 1] || 'No name', fileName: savePathSplit[savePathSplit.length - 1] || 'No name',
}; };
logger.info( logger.info(