Compare commits
No commits in common. "b5a853b8d462ad0cbc74bd3db315db42611c7904" and "f6d4a7de3d8b4735db9fac6b16e0bd22207c661c" have entirely different histories.
b5a853b8d4
...
f6d4a7de3d
@ -35,11 +35,6 @@ class FolderMonitor extends EventEmitter {
|
|||||||
|
|
||||||
this._watcher = chokidar.watch(folderPath, watchOptions);
|
this._watcher = chokidar.watch(folderPath, watchOptions);
|
||||||
this._watcher.on('add', (filePath) => this._onNewFile(filePath));
|
this._watcher.on('add', (filePath) => this._onNewFile(filePath));
|
||||||
this._watcher.on('unlink', (filePath) => {
|
|
||||||
// Allow re-added files (e.g. re-encoded) to be detected again
|
|
||||||
const normalized = filePath.replace(/\\/g, '/').toLowerCase();
|
|
||||||
this._seenFiles.delete(normalized);
|
|
||||||
});
|
|
||||||
this._watcher.on('error', (err) => this.emit('error', err));
|
this._watcher.on('error', (err) => this.emit('error', err));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
13
main.js
13
main.js
@ -883,22 +883,11 @@ ipcMain.handle('save-global-settings', async (_event, globalSettings) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Synchronous save for beforeunload — blocks renderer until write completes
|
// Synchronous save for beforeunload — blocks renderer until write completes
|
||||||
// Uses atomic write pattern (tmp + backup + rename) to prevent corruption
|
|
||||||
ipcMain.on('save-global-settings-sync', (event, globalSettings) => {
|
ipcMain.on('save-global-settings-sync', (event, globalSettings) => {
|
||||||
try {
|
try {
|
||||||
const current = configStore.load();
|
const current = configStore.load();
|
||||||
current.globalSettings = globalSettings;
|
current.globalSettings = globalSettings;
|
||||||
const data = JSON.stringify(current, null, 2);
|
fs.writeFileSync(configStore.filePath, JSON.stringify(current, null, 2));
|
||||||
const tmpPath = configStore.filePath + '.tmp';
|
|
||||||
const backupPath = configStore.filePath + '.bak';
|
|
||||||
fs.writeFileSync(tmpPath, data, 'utf-8');
|
|
||||||
if (fs.existsSync(configStore.filePath)) {
|
|
||||||
const existing = fs.readFileSync(configStore.filePath, 'utf-8');
|
|
||||||
if (existing && existing.trim().length > 2) {
|
|
||||||
fs.writeFileSync(backupPath, existing, 'utf-8');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fs.renameSync(tmpPath, configStore.filePath);
|
|
||||||
} catch {}
|
} catch {}
|
||||||
event.returnValue = true;
|
event.returnValue = true;
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "multi-hoster-uploader",
|
"name": "multi-hoster-uploader",
|
||||||
"version": "2.2.9",
|
"version": "2.2.8",
|
||||||
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
|
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user