🐛 fix: skipped jobs now show error instead of stuck 'Wartet' forever
When buildUploadTasksFromJobs skips jobs (e.g. no valid account for a hoster), the main process now returns their IDs + reason. The renderer marks them as 'error' with a descriptive message instead of leaving them stuck in 'Wartet' (queued) status with no feedback. Previously: jobs silently stayed at 'Wartet' forever if their hoster had no configured/enabled account. User had no idea why they weren't uploading. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c7343175ca
commit
17fbb98c13
13
main.js
13
main.js
@ -661,9 +661,18 @@ ipcMain.handle('start-upload', (_event, payload) => {
|
||||
? buildUploadTasksFromJobs(config, jobs)
|
||||
: buildUploadTasks(config, files, hosters);
|
||||
|
||||
// Identify jobs that were skipped (no account/credentials)
|
||||
const taskJobIds = new Set(tasks.map(t => t.jobId).filter(Boolean));
|
||||
const skippedJobs = jobs.filter(j => j.id && !taskJobIds.has(j.id)).map(j => ({
|
||||
jobId: j.id, hoster: j.hoster, reason: 'Kein gültiger Account für diesen Hoster'
|
||||
}));
|
||||
if (skippedJobs.length > 0) {
|
||||
debugLog(` skipped ${skippedJobs.length} jobs: ${skippedJobs.map(s => s.hoster).join(', ')}`);
|
||||
}
|
||||
|
||||
debugLog(` tasks built: ${tasks.length}`);
|
||||
|
||||
if (tasks.length === 0) return { error: 'Keine gültigen Zugangsdaten für die gewählten Hoster.' };
|
||||
if (tasks.length === 0) return { error: 'Keine gültigen Zugangsdaten für die gewählten Hoster.', skippedJobs };
|
||||
|
||||
// Pass hoster settings to the upload manager
|
||||
uploadManager = new UploadManager(config.hosterSettings || {}, config.globalSettings || {});
|
||||
@ -752,7 +761,7 @@ ipcMain.handle('start-upload', (_event, payload) => {
|
||||
});
|
||||
|
||||
debugLog(`start-upload returning started=true (startBatch deferred to nextTick)`);
|
||||
return { started: true, taskCount: tasks.length };
|
||||
return { started: true, taskCount: tasks.length, skippedJobs };
|
||||
});
|
||||
|
||||
ipcMain.handle('cancel-upload', () => {
|
||||
|
||||
@ -1322,6 +1322,7 @@ async function startUpload() {
|
||||
}))
|
||||
};
|
||||
const result = await window.api.startUpload(uploadPayload);
|
||||
_markSkippedJobs(result);
|
||||
persistQueueStateSoon();
|
||||
|
||||
if (result && result.error) {
|
||||
@ -1338,6 +1339,18 @@ async function startUpload() {
|
||||
}
|
||||
}
|
||||
|
||||
function _markSkippedJobs(result) {
|
||||
if (!result || !Array.isArray(result.skippedJobs) || result.skippedJobs.length === 0) return;
|
||||
for (const skipped of result.skippedJobs) {
|
||||
const job = _jobIndexById.get(skipped.jobId);
|
||||
if (job) {
|
||||
job.status = 'error';
|
||||
job.error = skipped.reason || 'Kein gültiger Account';
|
||||
}
|
||||
}
|
||||
renderQueueTable();
|
||||
}
|
||||
|
||||
async function startSelectedUpload() {
|
||||
if (uploading) return;
|
||||
uploading = true; // set immediately to prevent double-click race
|
||||
@ -1373,6 +1386,7 @@ async function startSelectedUpload() {
|
||||
}))
|
||||
};
|
||||
const result = await window.api.startUpload(uploadPayload);
|
||||
_markSkippedJobs(result);
|
||||
persistQueueStateSoon();
|
||||
|
||||
if (result && result.error) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user