release: Multi-Hoster-Upload 2.1.10
This commit is contained in:
+23
-26
@@ -1563,40 +1563,37 @@ function suppressPreviewKeysStillSelected(keys) {
|
||||
// Build preview jobs from selected files x selected hosters (before upload starts)
|
||||
function buildQueuePreview() {
|
||||
const hosters = getSelectedHosters();
|
||||
if (hosters.length === 0) {
|
||||
queueJobs = queueJobs.filter(j => j.status !== 'preview');
|
||||
rebuildJobIndex();
|
||||
renderQueueTable();
|
||||
persistQueueStateSoon();
|
||||
return;
|
||||
}
|
||||
// Remove old preview jobs
|
||||
queueJobs = queueJobs.filter(j => j.status !== 'preview');
|
||||
|
||||
// Build a Set for fast existence checks
|
||||
const existingKeys = new Set();
|
||||
for (const j of queueJobs) {
|
||||
existingKeys.add(`${j.file}|${j.hoster}`);
|
||||
}
|
||||
if (hosters.length > 0) {
|
||||
const existingKeys = new Set();
|
||||
for (const j of queueJobs) {
|
||||
existingKeys.add(`${j.file}|${j.hoster}`);
|
||||
}
|
||||
|
||||
for (const file of selectedFiles) {
|
||||
for (const hoster of hosters) {
|
||||
const key = `${file.path}|${hoster}`;
|
||||
if (!existingKeys.has(key) && !_completedUploadKeys.has(key) && !_suppressedPreviewKeys.has(key)) {
|
||||
const job = {
|
||||
id: `preview-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
|
||||
file: file.path, fileName: file.name, hoster,
|
||||
status: 'preview', bytesUploaded: 0, bytesTotal: file.size || 0,
|
||||
speedKbs: 0, elapsed: 0, remaining: 0,
|
||||
error: null, result: null, attempt: 0, maxAttempts: 0, link: ''
|
||||
};
|
||||
queueJobs.push(job);
|
||||
existingKeys.add(key);
|
||||
for (const file of selectedFiles) {
|
||||
for (const hoster of hosters) {
|
||||
const key = `${file.path}|${hoster}`;
|
||||
if (!existingKeys.has(key) && !_completedUploadKeys.has(key) && !_suppressedPreviewKeys.has(key)) {
|
||||
const job = {
|
||||
id: `preview-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
|
||||
file: file.path, fileName: file.name, hoster,
|
||||
status: 'preview', bytesUploaded: 0, bytesTotal: file.size || 0,
|
||||
speedKbs: 0, elapsed: 0, remaining: 0,
|
||||
error: null, result: null, attempt: 0, maxAttempts: 0, link: ''
|
||||
};
|
||||
queueJobs.push(job);
|
||||
existingKeys.add(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rebuildJobIndex();
|
||||
_queueStatsCache = null;
|
||||
renderQueueTable();
|
||||
updateStatusBar();
|
||||
updateStatsPanel();
|
||||
persistQueueStateSoon();
|
||||
}
|
||||
|
||||
|
||||
+14
-6
@@ -2518,13 +2518,18 @@ select.hs-input { max-width: none; width: auto; min-width: 140px; }
|
||||
}
|
||||
|
||||
.view-sidebar-badge {
|
||||
height: 22px;
|
||||
min-width: 22px;
|
||||
padding: 2px 6px;
|
||||
display: inline-grid;
|
||||
place-items: center;
|
||||
padding: 0 7px;
|
||||
border-radius: 999px;
|
||||
background: rgba(255, 255, 255, .055);
|
||||
color: var(--text-dim);
|
||||
font-size: 10px;
|
||||
background: var(--accent);
|
||||
color: var(--accent-ink);
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
font-variant-numeric: tabular-nums;
|
||||
line-height: 1;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@@ -3768,11 +3773,14 @@ input[type="checkbox"] {
|
||||
display: grid;
|
||||
}
|
||||
|
||||
#upload-view .view-sidebar-copy,
|
||||
#upload-view .view-sidebar-badge {
|
||||
#upload-view .view-sidebar-copy {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#upload-view .view-sidebar-badge {
|
||||
display: grid;
|
||||
}
|
||||
|
||||
#upload-view .upload-sidebar-lower {
|
||||
min-width: 0;
|
||||
gap: 10px;
|
||||
|
||||
Reference in New Issue
Block a user