Compare commits

..

No commits in common. "fdac28040db2d18d16ebaedf6ac93b1e90c708b9" and "62a459353a36bc4307d8071ea631304cd5f0fcee" have entirely different histories.

2 changed files with 3 additions and 26 deletions

25
main.js
View File

@ -625,14 +625,7 @@ app.whenReady().then(() => {
const launchConfig = configStore.load();
const fm = launchConfig.globalSettings && launchConfig.globalSettings.folderMonitor;
if (fm && fm.enabled && fm.folderPath) {
if (fs.existsSync(fm.folderPath)) {
startFolderMonitor(fm);
} else {
debugLog(`folder-monitor auto-start skipped: path not found (${fm.folderPath})`);
// Persist the disable so the user gets a clean state on next launch
const gs = { ...launchConfig.globalSettings, folderMonitor: { ...fm, enabled: false } };
configStore.save({ globalSettings: gs }).catch(() => {});
}
}
} catch (err) {
debugLog(`folder-monitor auto-start failed: ${err.message}`);
@ -1058,27 +1051,11 @@ ipcMain.handle('import-backup', async (_event, legacyPassword) => {
const ts = new Date().toISOString().replace(/[:.]/g, '-');
const preImportPath = configStore.filePath.replace('.json', `.pre-import-${ts}.json`);
try { fs.copyFileSync(configStore.filePath, preImportPath); } catch {}
// Strip machine-specific state: absolute paths from the source machine will
// not exist on this one (e.g. C:\Users\Administrator\... vs \bakeredwin318\...).
// Any path that does not resolve locally is cleared so the user can re-set it
// instead of hitting silent failures later.
const importedGlobal = imported.globalSettings || {};
if (importedGlobal.logFilePath && !fs.existsSync(path.dirname(importedGlobal.logFilePath))) {
importedGlobal.logFilePath = '';
}
if (importedGlobal.folderMonitor && typeof importedGlobal.folderMonitor === 'object') {
const fm = importedGlobal.folderMonitor;
if (fm.folderPath && !fs.existsSync(fm.folderPath)) {
fm.folderPath = '';
fm.enabled = false;
}
}
importedGlobal.pendingQueue = null;
// Single atomic write — no split state, no TOCTOU race
const merged = {
hosters: imported.hosters,
hosterSettings: imported.hosterSettings,
globalSettings: importedGlobal,
globalSettings: imported.globalSettings,
history: imported.history || []
};
await configStore._atomicWrite(JSON.stringify(merged, null, 2));

View File

@ -1,6 +1,6 @@
{
"name": "multi-hoster-uploader",
"version": "2.8.1",
"version": "2.8.0",
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
"main": "main.js",
"scripts": {