Compare commits
No commits in common. "29ab989cbe0933376aad99de3b3c37ab39158f52" and "ad46c48c64262215c5bd23436c9c3f7250893f19" have entirely different histories.
29ab989cbe
...
ad46c48c64
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "multi-hoster-uploader",
|
||||
"version": "2.6.5",
|
||||
"version": "2.6.4",
|
||||
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
||||
@ -24,15 +24,6 @@ let queuePersistTimer = null;
|
||||
let settingsSaveTimer = null;
|
||||
let lastUploadStats = { state: 'idle', globalSpeedKbs: 0, totalBytes: 0, elapsed: 0, activeJobs: 0 };
|
||||
const AUTO_CHECK_PREF_KEY = 'autoHealthCheckBeforeUpload';
|
||||
const STARTABLE_QUEUE_STATUSES = new Set(['preview', 'queued', 'error', 'aborted', 'skipped']);
|
||||
|
||||
function isStartableQueueStatus(status) {
|
||||
return STARTABLE_QUEUE_STATUSES.has(status);
|
||||
}
|
||||
|
||||
function isStartableQueueJob(job) {
|
||||
return !!job && isStartableQueueStatus(job.status);
|
||||
}
|
||||
|
||||
// Queue state
|
||||
let queueJobs = []; // { id, file, fileName, hoster, status, bytesUploaded, bytesTotal, speedKbs, elapsed, remaining, error, result, attempt, maxAttempts, link }
|
||||
@ -630,9 +621,8 @@ function updateUploadView() {
|
||||
function updateStartButton() {
|
||||
const btn = document.getElementById('startUploadBtn');
|
||||
const hosters = getSelectedHosters();
|
||||
const hasQueuedJobs = queueJobs.some(isStartableQueueJob);
|
||||
const canBuildQueueFromSelection = selectedFiles.length > 0 && hosters.length > 0;
|
||||
btn.disabled = uploading || !(hasQueuedJobs || canBuildQueueFromSelection);
|
||||
const hasFiles = queueJobs.some(j => j.status === 'queued' || j.status === 'preview' || j.status === 'error');
|
||||
btn.disabled = uploading || hosters.length === 0 || !hasFiles;
|
||||
}
|
||||
|
||||
function updateQueueActionButtons() {
|
||||
@ -641,7 +631,7 @@ function updateQueueActionButtons() {
|
||||
const hasSelection = selectedJobIds.size > 0;
|
||||
const hasUploadSelection = queueJobs.some((job) => selectedJobIds.has(job.id) && ['done', 'error', 'aborted', 'skipped'].includes(job.status));
|
||||
const hasAbortSelection = queueJobs.some((job) => selectedJobIds.has(job.id) && ['preview', 'queued', 'getting-server', 'uploading', 'retrying'].includes(job.status));
|
||||
const hasStartableSelection = queueJobs.some((job) => selectedJobIds.has(job.id) && isStartableQueueStatus(job.status));
|
||||
const hasStartableSelection = queueJobs.some((job) => selectedJobIds.has(job.id) && ['preview', 'queued', 'error'].includes(job.status));
|
||||
const hasMovableSelection = hasSelection && !uploading;
|
||||
|
||||
const startSelectedBtn = document.getElementById('startSelectedBtn');
|
||||
@ -654,7 +644,7 @@ function updateQueueActionButtons() {
|
||||
const moveDownBtn = document.getElementById('moveDownBtn');
|
||||
const moveBottomBtn = document.getElementById('moveBottomBtn');
|
||||
|
||||
if (startSelectedBtn) startSelectedBtn.disabled = uploading || !hasStartableSelection;
|
||||
if (startSelectedBtn) startSelectedBtn.disabled = uploading || !hasStartableSelection || getSelectedHosters().length === 0;
|
||||
if (reuploadBtn) reuploadBtn.disabled = !hasUploadSelection;
|
||||
if (abortSelectedBtn) abortSelectedBtn.disabled = !hasAbortSelection;
|
||||
if (finishStopBtn) finishStopBtn.disabled = !uploading;
|
||||
@ -1309,17 +1299,10 @@ async function startUpload() {
|
||||
updateQueueActionButtons();
|
||||
|
||||
const hosters = getSelectedHosters();
|
||||
if (queueJobs.length === 0 && selectedFiles.length > 0) {
|
||||
if (hosters.length === 0) {
|
||||
alert('Bitte mindestens einen Hoster auswählen.');
|
||||
uploading = false;
|
||||
updateQueueActionButtons();
|
||||
return;
|
||||
}
|
||||
buildQueuePreview();
|
||||
}
|
||||
if (hosters.length === 0) { alert('Bitte mindestens einen Hoster auswählen.'); uploading = false; updateQueueActionButtons(); return; }
|
||||
if (queueJobs.length === 0 && selectedFiles.length > 0) buildQueuePreview();
|
||||
|
||||
const jobsToStart = queueJobs.filter((job) => isStartableQueueStatus(job.status));
|
||||
const jobsToStart = queueJobs.filter((job) => job.status === 'preview' || job.status === 'queued' || job.status === 'error');
|
||||
if (jobsToStart.length === 0) { uploading = false; updateQueueActionButtons(); return; }
|
||||
|
||||
try {
|
||||
@ -1433,7 +1416,9 @@ async function startSelectedUpload() {
|
||||
updateQueueActionButtons();
|
||||
|
||||
const hosters = getSelectedHosters();
|
||||
const jobsToStart = queueJobs.filter((job) => selectedJobIds.has(job.id) && isStartableQueueStatus(job.status));
|
||||
if (hosters.length === 0) { alert('Bitte mindestens einen Hoster auswählen.'); uploading = false; updateQueueActionButtons(); return; }
|
||||
|
||||
const jobsToStart = queueJobs.filter((job) => selectedJobIds.has(job.id) && ['preview', 'queued', 'error', 'aborted', 'skipped'].includes(job.status));
|
||||
if (jobsToStart.length === 0) { uploading = false; updateQueueActionButtons(); return; }
|
||||
|
||||
try {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user