Compare commits

...

2 Commits

Author SHA1 Message Date
Administrator
c70f105685 release: v3.2.1 2026-04-22 18:17:35 +02:00
Administrator
0c301c8182 fix(queue): consistent "Bereit" after restart — no more Wartet/Bereit mix
buildPersistedQueueState persisted every non-aborted job's status
as-is. At restart no upload manager exists, so a serialized 'queued'
or 'uploading' job showed up as "Wartet" / "Upload" even though
nothing was actually running — next to a "Bereit" job for the same
file on a different hoster (screenshot the user sent).

Collapse every non-terminal state (queued, getting-server, uploading,
retrying, aborted) to 'preview' during persistence. Terminal states
(done, error, skipped) survive as-is so the user keeps their history
/ error messages. Also clears error/result when collapsing so the
restored preview row doesn't carry stale failure text.
2026-04-22 18:17:10 +02:00
2 changed files with 21 additions and 13 deletions

View File

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

View File

@ -563,21 +563,29 @@ 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 => ({
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
}))
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
};
})
};
}