feat(scheduler): add folder_scan_enabled toggle to SchedulerConfig
- Add folder_scan_enabled boolean field (default false) to SchedulerConfig - Update data/config.json example with new field - Add checkbox to setup.html and include in JS payload - Handle field in auth.py setup endpoint - Expose field in scheduler API response - Log and return field in scheduler_service.py - Update docs/CONFIGURATION.md and docs/ARCHITECTURE.md - Update index.html UI, app.js and scheduler-config.js handlers - Verified backward compatibility: old configs load with default False
This commit is contained in:
@@ -1561,6 +1561,8 @@ class AniWorldApp {
|
||||
document.getElementById('scheduled-rescan-enabled').checked = !!config.enabled;
|
||||
document.getElementById('scheduled-rescan-time').value = config.schedule_time || '03:00';
|
||||
document.getElementById('auto-download-after-rescan').checked = !!config.auto_download_after_rescan;
|
||||
const folderScanEl = document.getElementById('folder-scan-enabled');
|
||||
if (folderScanEl) folderScanEl.checked = !!config.folder_scan_enabled;
|
||||
|
||||
// Update day-of-week checkboxes
|
||||
const days = Array.isArray(config.schedule_days) ? config.schedule_days : ['mon','tue','wed','thu','fri','sat','sun'];
|
||||
@@ -1603,6 +1605,8 @@ class AniWorldApp {
|
||||
const enabled = document.getElementById('scheduled-rescan-enabled').checked;
|
||||
const scheduleTime = document.getElementById('scheduled-rescan-time').value || '03:00';
|
||||
const autoDownload = document.getElementById('auto-download-after-rescan').checked;
|
||||
const folderScanEl = document.getElementById('folder-scan-enabled');
|
||||
const folderScan = folderScanEl ? folderScanEl.checked : false;
|
||||
|
||||
// Collect checked day-of-week values
|
||||
const scheduleDays = ['mon','tue','wed','thu','fri','sat','sun']
|
||||
@@ -1618,7 +1622,8 @@ class AniWorldApp {
|
||||
enabled: enabled,
|
||||
schedule_time: scheduleTime,
|
||||
schedule_days: scheduleDays,
|
||||
auto_download_after_rescan: autoDownload
|
||||
auto_download_after_rescan: autoDownload,
|
||||
folder_scan_enabled: folderScan
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
@@ -35,6 +35,11 @@ AniWorld.SchedulerConfig = (function() {
|
||||
autoDownload.checked = config.auto_download_after_rescan || false;
|
||||
}
|
||||
|
||||
const folderScan = document.getElementById('folder-scan-enabled');
|
||||
if (folderScan) {
|
||||
folderScan.checked = config.folder_scan_enabled || false;
|
||||
}
|
||||
|
||||
// Update schedule day checkboxes
|
||||
const days = config.schedule_days || ['mon','tue','wed','thu','fri','sat','sun'];
|
||||
['mon','tue','wed','thu','fri','sat','sun'].forEach(function(day) {
|
||||
@@ -82,12 +87,16 @@ AniWorld.SchedulerConfig = (function() {
|
||||
const autoDownloadEl = document.getElementById('auto-download-after-rescan');
|
||||
const autoDownload = autoDownloadEl ? autoDownloadEl.checked : false;
|
||||
|
||||
const folderScanEl = document.getElementById('folder-scan-enabled');
|
||||
const folderScan = folderScanEl ? folderScanEl.checked : false;
|
||||
|
||||
// POST directly to the scheduler config endpoint
|
||||
const payload = {
|
||||
enabled: enabled,
|
||||
schedule_time: scheduleTime,
|
||||
schedule_days: scheduleDays,
|
||||
auto_download_after_rescan: autoDownload
|
||||
auto_download_after_rescan: autoDownload,
|
||||
folder_scan_enabled: folderScan
|
||||
};
|
||||
|
||||
const response = await AniWorld.ApiClient.post(API.SCHEDULER_CONFIG, payload);
|
||||
|
||||
Reference in New Issue
Block a user