Compare commits

..

No commits in common. "389be8f0fc954ed518412c8f06dc3f4f62cb5d09" and "d601bd7986b8efc6c06a05c090774be99926281b" have entirely different histories.

7 changed files with 39 additions and 66 deletions

View File

@ -210,8 +210,7 @@ class DoodstreamUploader {
let preamble = '';
preamble += `--${boundary}\r\nContent-Disposition: form-data; name="sess_id"\r\n\r\n${this.sessId}\r\n`;
preamble += `--${boundary}\r\nContent-Disposition: form-data; name="utype"\r\n\r\nreg\r\n`;
const safeFileName = fileName.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
preamble += `--${boundary}\r\nContent-Disposition: form-data; name="file"; filename="${safeFileName}"\r\nContent-Type: application/octet-stream\r\n\r\n`;
preamble += `--${boundary}\r\nContent-Disposition: form-data; name="file"; filename="${fileName}"\r\nContent-Type: application/octet-stream\r\n\r\n`;
const epilogue = `\r\n--${boundary}--\r\n`;
const preambleBuf = Buffer.from(preamble, 'utf-8');

View File

@ -232,8 +232,7 @@ function buildMultipart(filePath, formFields) {
preamble += `${value}\r\n`;
}
preamble += `--${boundary}\r\n`;
const safeFileName = fileName.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
preamble += `Content-Disposition: form-data; name="file"; filename="${safeFileName}"\r\n`;
preamble += `Content-Disposition: form-data; name="file"; filename="${fileName}"\r\n`;
preamble += `Content-Type: application/octet-stream\r\n\r\n`;
const epilogue = `\r\n--${boundary}--\r\n`;

View File

@ -200,8 +200,7 @@ class VidmolyUploader {
preamble += `${value}\r\n`;
}
preamble += `--${boundary}\r\n`;
const safeFileName = fileName.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
preamble += `Content-Disposition: form-data; name="${fileFieldName || 'file'}"; filename="${safeFileName}"\r\n`;
preamble += `Content-Disposition: form-data; name="${fileFieldName || 'file'}"; filename="${fileName}"\r\n`;
preamble += `Content-Type: application/octet-stream\r\n\r\n`;
const epilogue = `\r\n--${boundary}--\r\n`;
@ -217,7 +216,6 @@ class VidmolyUploader {
yield preambleBuf;
const fileStream = fs.createReadStream(filePath, { highWaterMark: CHUNK_SIZE });
for await (const chunk of fileStream) {
if (signal && signal.aborted) throw new Error('Aborted');
if (throttle) await throttle.consume(chunk.length, signal);
bytesRead += chunk.length;
yield chunk;

View File

@ -228,8 +228,7 @@ class VoeUploader {
preamble += `${sessionId}\r\n`;
}
preamble += `--${boundary}\r\n`;
const safeFileName = fileName.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
preamble += `Content-Disposition: form-data; name="file"; filename="${safeFileName}"\r\n`;
preamble += `Content-Disposition: form-data; name="file"; filename="${fileName}"\r\n`;
preamble += `Content-Type: application/octet-stream\r\n\r\n`;
const epilogue = `\r\n--${boundary}--\r\n`;
@ -245,7 +244,6 @@ class VoeUploader {
yield preambleBuf;
const fileStream = fs.createReadStream(filePath, { highWaterMark: CHUNK_SIZE });
for await (const chunk of fileStream) {
if (signal && signal.aborted) throw new Error('Aborted');
if (throttle) await throttle.consume(chunk.length, signal);
bytesRead += chunk.length;
yield chunk;

View File

@ -802,10 +802,6 @@ ipcMain.handle('import-backup', async (_event, password) => {
if (canceled || !filePaths.length) return { ok: false, canceled: true };
const buffer = fs.readFileSync(filePaths[0]);
const imported = backupCrypto.decrypt(buffer, password);
// Validate imported data has required structure
if (!imported || typeof imported !== 'object' || !imported.hosters || !imported.hosterSettings || !imported.globalSettings) {
return { ok: false, error: 'Backup-Datei hat ungültige Struktur (hosters, hosterSettings oder globalSettings fehlt).' };
}
// Safety net: timestamped backup so multiple imports don't overwrite each other
const ts = new Date().toISOString().replace(/[:.]/g, '-');
const preImportPath = configStore.filePath.replace('.json', `.pre-import-${ts}.json`);

View File

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

View File

@ -1310,9 +1310,7 @@ function getSelectedJobLinks() {
// --- Upload ---
async function startUpload() {
if (uploading) return;
// Wait for any running health check to finish (e.g. startup auto-check)
while (healthCheckRunning) await new Promise(r => setTimeout(r, 100));
if (healthCheckRunning || uploading) return;
uploading = true; // set immediately to prevent double-click race
updateQueueActionButtons();
@ -1347,7 +1345,6 @@ async function startUpload() {
}
}
try {
queueJobs.forEach(j => {
if (j.status === 'preview') j.status = 'queued';
});
@ -1373,17 +1370,10 @@ async function startUpload() {
updateQueueActionButtons();
updateStatusBar();
}
} catch (err) {
uploading = false;
updateQueueActionButtons();
updateStatusBar();
alert(`Upload-Start fehlgeschlagen: ${err.message}`);
}
}
async function startSelectedUpload() {
if (uploading) return;
while (healthCheckRunning) await new Promise(r => setTimeout(r, 100));
if (healthCheckRunning || uploading) return;
uploading = true; // set immediately to prevent double-click race
updateQueueActionButtons();
@ -1417,7 +1407,6 @@ async function startSelectedUpload() {
}
}
try {
jobsToStart.forEach(j => {
if (j.status === 'preview') j.status = 'queued';
});
@ -1443,12 +1432,6 @@ async function startSelectedUpload() {
updateQueueActionButtons();
updateStatusBar();
}
} catch (err) {
uploading = false;
updateQueueActionButtons();
updateStatusBar();
alert(`Upload-Start fehlgeschlagen: ${err.message}`);
}
}
async function cancelUpload() {