Compare commits

..

No commits in common. "77496998304435ed1b7f1451a37eafe9a639a37d" and "b93617ace9146f443a8281924e1944a0b41bb603" have entirely different histories.

2 changed files with 7 additions and 50 deletions

View File

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

View File

@ -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,7 +1800,6 @@ 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).');