Compare commits
No commits in common. "f6d4a7de3d8b4735db9fac6b16e0bd22207c661c" and "af48a485e8a3c3cfc47c2dadab4063cc005da8f2" have entirely different histories.
f6d4a7de3d
...
af48a485e8
@ -550,7 +550,6 @@ class UploadManager extends EventEmitter {
|
||||
}
|
||||
|
||||
_startStatsTimer() {
|
||||
if (this.statsInterval) clearInterval(this.statsInterval);
|
||||
this.statsInterval = setInterval(() => {
|
||||
let globalSpeedKbs = 0;
|
||||
let activeCount = 0;
|
||||
|
||||
25
main.js
25
main.js
@ -1258,11 +1258,6 @@ let shutdownTimer = null;
|
||||
|
||||
ipcMain.handle('set-shutdown-after-finish', (_event, mode) => {
|
||||
shutdownMode = mode || 'nothing';
|
||||
// Cancel active countdown if mode changed to 'nothing'
|
||||
if (shutdownMode === 'nothing' && shutdownTimer) {
|
||||
clearTimeout(shutdownTimer);
|
||||
shutdownTimer = null;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
@ -1283,25 +1278,21 @@ function handleShutdownAfterFinish() {
|
||||
if (shutdownMode === 'nothing') return;
|
||||
|
||||
const { exec } = require('child_process');
|
||||
const mode = shutdownMode;
|
||||
|
||||
// Notify renderer
|
||||
if (mainWindow && !mainWindow.isDestroyed()) {
|
||||
mainWindow.webContents.send('shutdown-countdown', { mode: shutdownMode, seconds: 60 });
|
||||
mainWindow.webContents.send('shutdown-countdown', { mode, seconds: 60 });
|
||||
}
|
||||
|
||||
// Clear any previous countdown to prevent orphaned timers
|
||||
if (shutdownTimer) clearTimeout(shutdownTimer);
|
||||
|
||||
shutdownTimer = setTimeout(() => {
|
||||
// Read current mode at execution time (not captured at scheduling time)
|
||||
if (shutdownMode === 'shutdown') {
|
||||
exec('shutdown /s /t 0', (err) => { if (err) debugLog(`shutdown failed: ${err.message}`); });
|
||||
} else if (shutdownMode === 'restart') {
|
||||
exec('shutdown /r /t 0', (err) => { if (err) debugLog(`restart failed: ${err.message}`); });
|
||||
} else if (shutdownMode === 'sleep') {
|
||||
exec('rundll32.exe powrprof.dll,SetSuspendState 0,1,0', (err) => { if (err) debugLog(`sleep failed: ${err.message}`); });
|
||||
if (mode === 'shutdown') {
|
||||
exec('shutdown /s /t 0');
|
||||
} else if (mode === 'restart') {
|
||||
exec('shutdown /r /t 0');
|
||||
} else if (mode === 'sleep') {
|
||||
exec('rundll32.exe powrprof.dll,SetSuspendState 0,1,0');
|
||||
}
|
||||
// else: mode was changed to 'nothing' during countdown — do nothing
|
||||
}, 60000);
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "multi-hoster-uploader",
|
||||
"version": "2.2.8",
|
||||
"version": "2.2.7",
|
||||
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user