feat: add upload schedule windows

Add local weekly upload windows with overnight support, live settings updates, and a shared abortable upload gate.

Keep active transfers running while queued jobs wait outside the window without consuming attempts or parallel slots. Validate and localize the automation settings in German and English, including next-start status and hidden Electron coverage.
This commit is contained in:
Sucukdeluxe
2026-08-16 23:56:13 +02:00
parent 2eaa30c0a8
commit c8170b8556
11 changed files with 708 additions and 3 deletions
+36
View File
@@ -126,6 +126,12 @@ describe('ConfigStore', () => {
matchMode: 'all',
conditions: []
});
assert.deepEqual(config.globalSettings.uploadSchedule, {
enabled: false,
weekdays: [1, 2, 3, 4, 5, 6, 0],
start: '00:00',
end: '23:59'
});
assert.deepEqual(config.history, []);
});
@@ -383,6 +389,36 @@ describe('ConfigStore', () => {
assert.equal(config.globalSettings.logFilePath, '');
});
it('normalizes upload schedules across load and save boundaries', async () => {
fs.writeFileSync(store.filePath, JSON.stringify({
globalSettings: {
uploadSchedule: { enabled: true, weekdays: [0, 1, 1, 9], start: ' 22:00 ', end: '06:00' }
}
}), 'utf-8');
assert.deepEqual(store.load().globalSettings.uploadSchedule, {
enabled: true,
weekdays: [1, 0],
start: '22:00',
end: '06:00'
});
const current = store.load();
await store.save({
globalSettings: {
...current.globalSettings,
uploadSchedule: { enabled: true, weekdays: [], start: '08:00', end: '08:00' }
}
});
assert.deepEqual(store.load().globalSettings.uploadSchedule, {
enabled: true,
weekdays: [],
start: '08:00',
end: '08:00'
});
});
it('concurrent saves preserve both sections', async () => {
const save1 = store.save({ hosters: { 'doodstream.com': [{ id: 'c1', enabled: true, authType: 'api', apiKey: 'concurrent-key' }] } });
const save2 = store.save({ globalSettings: { alwaysOnTop: true } });