Compare commits
No commits in common. "master" and "v3.3.55" have entirely different histories.
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "multi-hoster-uploader",
|
||||
"version": "3.3.58",
|
||||
"version": "3.3.55",
|
||||
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
||||
@ -99,7 +99,6 @@ async function init() {
|
||||
syncSelectedUploadHosters();
|
||||
restoreQueueStateFromConfig();
|
||||
await _autoDeduplicateFromLog();
|
||||
_hydrateMissingJobSizes();
|
||||
renderHosterSummary();
|
||||
renderHosterModal();
|
||||
renderSettings();
|
||||
@ -998,54 +997,12 @@ function scheduleStatusChangeUpdate() {
|
||||
});
|
||||
}
|
||||
|
||||
function _hydrateMissingJobSizes(jobsLike) {
|
||||
if (!window.api || !window.api.getFileSizes) return;
|
||||
const paths = [];
|
||||
const seen = new Set();
|
||||
const source = Array.isArray(jobsLike) ? jobsLike : queueJobs;
|
||||
for (const j of source) {
|
||||
if (!j || !j.file) continue;
|
||||
if (j.bytesTotal && j.bytesTotal > 0) continue;
|
||||
if (seen.has(j.file)) continue;
|
||||
seen.add(j.file);
|
||||
paths.push(j.file);
|
||||
}
|
||||
if (paths.length === 0) return;
|
||||
window.api.getFileSizes(paths).then((sizeMap) => {
|
||||
if (!sizeMap || typeof sizeMap !== 'object') return;
|
||||
let changed = false;
|
||||
for (const j of queueJobs) {
|
||||
if (sizeMap[j.file] && (!j.bytesTotal || j.bytesTotal === 0)) {
|
||||
j.bytesTotal = sizeMap[j.file];
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
for (const f of selectedFiles) {
|
||||
if (sizeMap[f.path] && (!f.size || f.size === 0)) f.size = sizeMap[f.path];
|
||||
}
|
||||
if (changed) {
|
||||
_queueStatsCache = null;
|
||||
if (typeof renderQueueTable === 'function') renderQueueTable();
|
||||
if (typeof updateStatusBar === 'function') updateStatusBar();
|
||||
}
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
function _formatUploadedSize(job) {
|
||||
const bt = job.bytesTotal || 0;
|
||||
const bu = job.bytesUploaded || 0;
|
||||
const s = job.status;
|
||||
if (s === 'preview') return bt > 0 ? formatSize(bt) : '...';
|
||||
if (s === 'queued' || s === 'getting-server' || s === 'retrying') {
|
||||
return bt > 0 ? `${formatSize(bu)} / ${formatSize(bt)}` : '...';
|
||||
}
|
||||
return `${formatSize(bu)} / ${formatSize(bt)}`;
|
||||
}
|
||||
|
||||
function buildRowHtml(job) {
|
||||
const statusClass = `status-${job.status}`;
|
||||
const rowClass = `queue-row ${statusClass}${selectedJobIds.has(job.id) ? ' selected' : ''}`;
|
||||
const uploadedSize = _formatUploadedSize(job);
|
||||
const uploadedSize = job.status === 'preview'
|
||||
? (job.bytesTotal > 0 ? formatSize(job.bytesTotal) : '...')
|
||||
: `${formatSize(job.bytesUploaded)} / ${formatSize(job.bytesTotal)}`;
|
||||
const statusText = getStatusText(job);
|
||||
const elapsed = formatTime(job.elapsed);
|
||||
const remaining = formatTime(job.remaining);
|
||||
@ -1075,7 +1032,9 @@ function buildRowHtml(job) {
|
||||
// In-place update of a single row's cells (avoids full innerHTML rebuild)
|
||||
function _updateRowInPlace(tr, job) {
|
||||
const statusClass = `status-${job.status}`;
|
||||
const uploadedSize = _formatUploadedSize(job);
|
||||
const uploadedSize = job.status === 'preview'
|
||||
? (job.bytesTotal > 0 ? formatSize(job.bytesTotal) : '...')
|
||||
: `${formatSize(job.bytesUploaded)} / ${formatSize(job.bytesTotal)}`;
|
||||
const statusText = getStatusText(job);
|
||||
const elapsed = formatTime(job.elapsed);
|
||||
const remaining = formatTime(job.remaining);
|
||||
@ -1769,7 +1728,6 @@ async function startUpload() {
|
||||
if (uploading) return;
|
||||
uploading = true; // set immediately to prevent double-click race
|
||||
updateQueueActionButtons();
|
||||
_hydrateMissingJobSizes();
|
||||
|
||||
const hosters = getSelectedHosters();
|
||||
if (queueJobs.length === 0 && selectedFiles.length > 0) {
|
||||
@ -1842,13 +1800,10 @@ function _markSkippedJobs(result) {
|
||||
|
||||
async function startSelectedUpload() {
|
||||
if (uploading) {
|
||||
_hydrateMissingJobSizes();
|
||||
const addable = queueJobs.filter(j => selectedJobIds.has(j.id) && isStartableQueueStatus(j.status));
|
||||
if (addable.length === 0) {
|
||||
if (selectedJobIds.size > 0) showCopyToast('Keine startbaren Jobs ausgewählt (alle laufen schon oder sind fertig).');
|
||||
return;
|
||||
}
|
||||
{
|
||||
// Batch already running — add selected jobs (queued/error/aborted/skipped) to running batch
|
||||
// Upload-manager has duplicate protection (skips jobs already tracked)
|
||||
const addable = queueJobs.filter(j => selectedJobIds.has(j.id) && ['queued', 'error', 'aborted', 'skipped'].includes(j.status));
|
||||
if (addable.length > 0) {
|
||||
addable.forEach(j => {
|
||||
j.status = 'queued'; j.error = null; j.result = null;
|
||||
j.bytesUploaded = 0; j.speedKbs = 0; j.progress = 0; j.uploadId = null;
|
||||
@ -1893,6 +1848,7 @@ async function startSelectedUpload() {
|
||||
}
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
uploading = true; // set immediately to prevent double-click race
|
||||
updateQueueActionButtons();
|
||||
@ -2152,6 +2108,7 @@ function handleBatchDone(summary) {
|
||||
|
||||
lastUploadStats = { state: 'idle', globalSpeedKbs: 0, totalBytes: lastUploadStats.totalBytes, elapsed: lastUploadStats.elapsed, activeJobs: 0 };
|
||||
updateStatusBar();
|
||||
_maybeShowBatchSummary(summary);
|
||||
_refreshSessionFailedSnapshot();
|
||||
}
|
||||
|
||||
|
||||
@ -342,6 +342,22 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" id="batchSummaryModal" style="display:none">
|
||||
<div class="modal-content" style="max-width:680px">
|
||||
<div class="modal-header">
|
||||
<h2>Batch-Zusammenfassung</h2>
|
||||
<button class="icon-btn" id="batchSummaryClose" aria-label="Schließen">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="batchSummaryList"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-secondary" id="batchSummaryRetryTransient">Transiente erneut hochladen</button>
|
||||
<button class="btn btn-primary" id="batchSummaryRetryAll">Alle Fehler erneut versuchen</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="../lib/queue-prune.js"></script>
|
||||
<script src="../lib/queue-dedup.js"></script>
|
||||
<script src="../lib/log-mode.js"></script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user