Remove deprecated legacy interval field from setup and settings UI

This commit is contained in:
2026-02-22 17:42:01 +01:00
parent 747e1acc21
commit ddf10327c7
8 changed files with 7 additions and 74 deletions

View File

@@ -417,12 +417,12 @@ Source: [src/server/middleware/auth.py](../src/server/middleware/auth.py#L1-L209
#### Temp Directory Contract #### Temp Directory Contract
| Situation | Outcome | | Situation | Outcome |
| --------- | ------- | | -------------------------------- | ------------------------------------------------------------------- |
| Server start | Entire `./Temp/` directory is purged before any service initialises | | Server start | Entire `./Temp/` directory is purged before any service initialises |
| Successful download | Temp file moved to destination, then removed from `./Temp/` | | Successful download | Temp file moved to destination, then removed from `./Temp/` |
| Failed download (provider error) | Temp + `.part` fragments removed by `_cleanup_temp_file()` | | Failed download (provider error) | Temp + `.part` fragments removed by `_cleanup_temp_file()` |
| Exception / cancellation | Temp + `.part` fragments removed in `except` block | | Exception / cancellation | Temp + `.part` fragments removed in `except` block |
Source: [src/server/services/download_service.py](../src/server/services/download_service.py#L1-L150), Source: [src/server/services/download_service.py](../src/server/services/download_service.py#L1-L150),
[src/core/providers/aniworld_provider.py](../src/core/providers/aniworld_provider.py), [src/core/providers/aniworld_provider.py](../src/core/providers/aniworld_provider.py),

View File

@@ -121,5 +121,3 @@ For each task completed:
--- ---
1. ✅ On each download make sure the Temp files are deleted.
2. ✅ on each server start clean Temp folder

View File

@@ -144,7 +144,6 @@ AniWorld.MainConfig = (function() {
// Populate scheduler settings // Populate scheduler settings
document.getElementById('scheduled-rescan-enabled').checked = config.scheduler?.enabled || false; document.getElementById('scheduled-rescan-enabled').checked = config.scheduler?.enabled || false;
document.getElementById('scheduled-rescan-interval').value = config.scheduler?.interval_minutes || 60;
// Populate logging settings // Populate logging settings
document.getElementById('log-level').value = config.logging?.level || 'INFO'; document.getElementById('log-level').value = config.logging?.level || 'INFO';

View File

@@ -82,16 +82,12 @@ AniWorld.SchedulerConfig = (function() {
const autoDownloadEl = document.getElementById('auto-download-after-rescan'); const autoDownloadEl = document.getElementById('auto-download-after-rescan');
const autoDownload = autoDownloadEl ? autoDownloadEl.checked : false; const autoDownload = autoDownloadEl ? autoDownloadEl.checked : false;
const intervalEl = document.getElementById('scheduled-rescan-interval');
const interval = intervalEl ? (parseInt(intervalEl.value) || 60) : 60;
// POST directly to the scheduler config endpoint // POST directly to the scheduler config endpoint
const payload = { const payload = {
enabled: enabled, enabled: enabled,
schedule_time: scheduleTime, schedule_time: scheduleTime,
schedule_days: scheduleDays, schedule_days: scheduleDays,
auto_download_after_rescan: autoDownload, auto_download_after_rescan: autoDownload
interval_minutes: interval
}; };
const response = await AniWorld.ApiClient.post(API.SCHEDULER_CONFIG, payload); const response = await AniWorld.ApiClient.post(API.SCHEDULER_CONFIG, payload);

View File

@@ -305,17 +305,6 @@
</label> </label>
</div> </div>
<!-- Advanced: legacy interval (hidden by default) -->
<details class="config-advanced">
<summary data-text="advanced-settings">Advanced</summary>
<div class="config-item" id="rescan-interval-config">
<label for="scheduled-rescan-interval" data-text="rescan-interval">Legacy Check Interval (minutes):</label>
<input type="number" id="scheduled-rescan-interval" value="60" min="1" class="input-field">
<small class="config-hint" data-text="rescan-interval-hint">
Deprecated: only used if cron scheduling is not configured
</small>
</div>
</details>
<div class="config-item scheduler-status" id="scheduler-status"> <div class="config-item scheduler-status" id="scheduler-status">
<div class="scheduler-info"> <div class="scheduler-info">

View File

@@ -480,17 +480,6 @@
</label> </label>
</div> </div>
</div> </div>
<details class="form-advanced">
<summary>Advanced</summary>
<div class="form-row" style="margin-top:0.75rem">
<div class="form-group">
<label for="scheduler_interval_minutes" class="form-label">Legacy Interval (minutes)</label>
<input type="number" id="scheduler_interval_minutes" name="scheduler_interval_minutes"
class="form-input" value="60" min="1">
<div class="form-help">Deprecated: only used if cron scheduling is not configured.</div>
</div>
</div>
</details>
</div> </div>
<!-- Logging Settings --> <!-- Logging Settings -->
@@ -772,7 +761,6 @@
scheduler_schedule_time: document.getElementById('scheduler_schedule_time').value || '03:00', scheduler_schedule_time: document.getElementById('scheduler_schedule_time').value || '03:00',
scheduler_schedule_days: Array.from(document.querySelectorAll('.scheduler-day-setup-cb:checked')).map(cb => cb.value), scheduler_schedule_days: Array.from(document.querySelectorAll('.scheduler-day-setup-cb:checked')).map(cb => cb.value),
scheduler_auto_download_after_rescan: document.getElementById('scheduler_auto_download').checked, scheduler_auto_download_after_rescan: document.getElementById('scheduler_auto_download').checked,
scheduler_interval_minutes: parseInt(document.getElementById('scheduler_interval_minutes').value) || 60,
logging_level: document.getElementById('logging_level').value, logging_level: document.getElementById('logging_level').value,
logging_file: document.getElementById('logging_file').value.trim() || null, logging_file: document.getElementById('logging_file').value.trim() || null,
logging_max_bytes: document.getElementById('logging_max_bytes').value ? logging_max_bytes: document.getElementById('logging_max_bytes').value ?

View File

@@ -75,7 +75,6 @@ test.describe('Settings Modal - Configuration Sections', () => {
test('should display scheduler configuration section', async ({ page }) => { test('should display scheduler configuration section', async ({ page }) => {
await expect(page.locator('text=Scheduled Operations')).toBeVisible(); await expect(page.locator('text=Scheduled Operations')).toBeVisible();
await expect(page.locator('#scheduled-rescan-enabled')).toBeVisible(); await expect(page.locator('#scheduled-rescan-enabled')).toBeVisible();
await expect(page.locator('#scheduled-rescan-interval')).toBeVisible();
}); });
test('should display NFO settings section', async ({ page }) => { test('should display NFO settings section', async ({ page }) => {
@@ -177,29 +176,6 @@ test.describe('Settings Modal - Edit Configuration', () => {
expect(newState).not.toBe(initialState); expect(newState).not.toBe(initialState);
}); });
test('should allow editing scheduler interval', async ({ page }) => {
const intervalInput = page.locator('#scheduled-rescan-interval');
await intervalInput.clear();
await intervalInput.fill('120');
const value = await intervalInput.inputValue();
expect(value).toBe('120');
});
test('should validate scheduler interval is positive', async ({ page }) => {
const intervalInput = page.locator('#scheduled-rescan-interval');
await intervalInput.clear();
await intervalInput.fill('0');
// HTML5 validation should prevent this
const validationMessage = await intervalInput.evaluate(
(el: HTMLInputElement) => el.validationMessage
);
expect(validationMessage).toBeTruthy();
});
test('should series count field be readonly', async ({ page }) => { test('should series count field be readonly', async ({ page }) => {
const seriesCount = page.locator('#series-count-input'); const seriesCount = page.locator('#series-count-input');

View File

@@ -108,16 +108,6 @@ test.describe('Setup Page - Form Validation', () => {
expect(validationMessage).toBeTruthy(); expect(validationMessage).toBeTruthy();
}); });
test('should validate scheduler interval is positive', async ({ page }) => {
const intervalInput = page.locator('#scheduler_interval_minutes');
await intervalInput.fill('0');
const validationMessage = await intervalInput.evaluate(
(el: HTMLInputElement) => el.validationMessage
);
expect(validationMessage).toBeTruthy();
});
}); });
test.describe('Setup Page - Password Strength Indicator', () => { test.describe('Setup Page - Password Strength Indicator', () => {
@@ -239,14 +229,11 @@ test.describe('Setup Page - Configuration Sections', () => {
test('should have scheduler settings with checkbox', async ({ page }) => { test('should have scheduler settings with checkbox', async ({ page }) => {
const enabledCheckbox = page.locator('#scheduler_enabled'); const enabledCheckbox = page.locator('#scheduler_enabled');
const intervalInput = page.locator('#scheduler_interval_minutes');
await expect(enabledCheckbox).toBeVisible(); await expect(enabledCheckbox).toBeVisible();
await expect(intervalInput).toBeVisible();
// Should be enabled by default // Should be enabled by default
await expect(enabledCheckbox).toBeChecked(); await expect(enabledCheckbox).toBeChecked();
await expect(intervalInput).toHaveValue('60');
}); });
test('should allow toggling scheduler enabled', async ({ page }) => { test('should allow toggling scheduler enabled', async ({ page }) => {