diff --git a/lib/config-store.js b/lib/config-store.js index add1e54..5f9b277 100644 --- a/lib/config-store.js +++ b/lib/config-store.js @@ -49,7 +49,8 @@ const DEFAULTS = { extensions: '', // comma-separated: 'mp4,mkv,avi' skipDuplicates: true, delaySec: 3, - autoStart: true + autoStart: true, + hosters: [] // pre-selected hosters, empty = ask via modal } }, history: [] diff --git a/renderer/app.js b/renderer/app.js index aab6945..cdd7857 100644 --- a/renderer/app.js +++ b/renderer/app.js @@ -80,9 +80,11 @@ async function init() { window.api.onFolderMonitorNewFiles((files) => { window.api.debugLog('folder-monitor: received ' + files.length + ' file(s)'); const fm = config.globalSettings && config.globalSettings.folderMonitor; - const hosters = getSelectedHosters(); - if (hosters.length > 0 && fm && fm.autoStart) { - // Add files directly to queue and start upload + const fmHosters = fm && Array.isArray(fm.hosters) && fm.hosters.length > 0 ? fm.hosters : []; + + if (fmHosters.length > 0) { + // Pre-selected hosters: set them as active selection and add directly to queue + selectedUploadHosters = fmHosters.slice(); const newFiles = []; for (const p of files) { if (!selectedFiles.find(f => f.path === p) && !_pendingFiles.find(f => f.path === p)) { @@ -94,9 +96,10 @@ async function init() { selectedFiles.push(...newFiles); buildQueuePreview(); updateUploadView(); - if (!uploading && !healthCheckRunning) startUpload(); + if (fm.autoStart && !uploading && !healthCheckRunning) startUpload(); } } else { + // No pre-selected hosters: open modal addPathsToQueue(files); } }); @@ -1784,7 +1787,7 @@ function renderSettings() {
Erst Accounts anlegen, dann hier auswählen.
' : 'Keine Auswahl = Hoster-Modal bei jeder Datei.
'} `; container.appendChild(folderMonitorPanel); @@ -2023,7 +2035,8 @@ async function saveSettings(options = {}) { extensions: (document.getElementById('fmExtensionsInput')?.value || '').trim(), skipDuplicates: !!document.getElementById('fmSkipDuplicatesInput')?.checked, delaySec: Math.max(1, parseInt(document.getElementById('fmDelaySecInput')?.value || '3', 10) || 3), - autoStart: !!document.getElementById('fmAutoStartInput')?.checked + autoStart: !!document.getElementById('fmAutoStartInput')?.checked, + hosters: Array.from(document.querySelectorAll('.fm-hoster-checkbox:checked')).map(el => el.dataset.fmHoster) } };