Compare commits

..

No commits in common. "c70f105685ad02995a78b0654296f0541fcb5b98" and "65f8d9a0e872284b778101bba271e19ca1a1678c" have entirely different histories.

2 changed files with 13 additions and 21 deletions

View File

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

View File

@ -563,29 +563,21 @@ function buildPersistedQueueState() {
return null;
}
// After a restart no upload manager is running, so any in-flight state
// (queued / getting-server / uploading / retrying / aborted) is
// meaningless. Collapse them all to 'preview' so the queue shows a
// consistent "Bereit" for everything that didn't actually terminate.
// Only true terminal states (done / error / skipped) survive as-is.
const TERMINAL = new Set(['done', 'error', 'skipped']);
return {
selectedUploadHosters: getSelectedHosters(),
selectedFiles: Array.from(selectedFileMap.values()),
queueJobs: queueJobs.map(job => {
const isTerminal = TERMINAL.has(job.status);
return {
id: job.id,
file: job.file,
fileName: job.fileName,
hoster: job.hoster,
status: isTerminal ? job.status : 'preview',
bytesTotal: job.bytesTotal || 0,
error: isTerminal ? (job.error || null) : null,
result: isTerminal ? (job.result || null) : null,
maxAttempts: job.maxAttempts || 0
};
})
queueJobs: queueJobs.map(job => ({
id: job.id,
file: job.file,
fileName: job.fileName,
hoster: job.hoster,
// Save aborted jobs as queued so they survive restart
status: job.status === 'aborted' ? 'queued' : job.status,
bytesTotal: job.bytesTotal || 0,
error: job.status === 'aborted' ? null : (job.error || null),
result: job.result || null,
maxAttempts: job.maxAttempts || 0
}))
};
}