Release 2.22.0: normalize playlist schedules and unify player sync
This commit is contained in:
1 parent
7748129307
commit
b71958cb38
39 files changed
+1174
-314
No files matched your search
@@ -62,6 +62,8 @@ test('playlist schedule summaries show up to two short rules on separate lines a
|
||||
[[{ days: [1] }, { days: [2] }, { days: [3] }, { days: [4] }], '4 rules'],
|
||||
[[{ start_datetime: '2026-10-25T09:00', end_datetime: '2026-10-26T17:00', days: [1] }],
|
||||
'Rule 1: Dates 2026-10-25 09:00 to 2026-10-26 17:00: Mon'],
|
||||
[[{ start_datetime: '2026-10-25T09:00' }], 'Rule 1: From 2026-10-25 09:00'],
|
||||
[[{ end_datetime: '2026-10-26T17:00' }], 'Rule 1: Until 2026-10-26 17:00'],
|
||||
[[{ start_datetime: new Date(2026, 0, 1, 0, 0), end_datetime: new Date(2026, 9, 30, 20, 0) }],
|
||||
'Rule 1: Dates 2026-01-01 00:00 to 2026-10-30 20:00'],
|
||||
[[{ start_datetime: '2026-10-25T09:00', end_datetime: '2026-10-26T17:00',
|
||||
@@ -91,6 +93,36 @@ test('playlist schedule summaries show up to two short rules on separate lines a
|
||||
assert.match(css, /\.playlist-schedule-summary \.chip\s*\{[^}]*display:\s*inline-block;[^}]*white-space:\s*pre-line;[^}]*overflow-wrap:\s*anywhere;/);
|
||||
});
|
||||
|
||||
test('live schedule validator accepts one datetime bound and still rejects reversed ranges', () => {
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const vm = require('node:vm');
|
||||
const source = fs.readFileSync(path.join(__dirname, '../src/web/public/js/playlists/playlist-schedule.js'), 'utf8');
|
||||
const start = source.lastIndexOf(' function validateScheduleRuleCard(card)');
|
||||
const end = source.indexOf(' function updateLiveRuleValidity(card)', start);
|
||||
const fields = {
|
||||
days: [],
|
||||
startDatetime: { value: '2026-10-25T09:00' },
|
||||
endDatetime: { value: '' },
|
||||
startTime: { value: '' },
|
||||
endTime: { value: '' }
|
||||
};
|
||||
const context = {
|
||||
getRuleFields: () => fields,
|
||||
getRuleDayLabels: () => [],
|
||||
getDateRangeDayIndices: () => [0, 1, 2, 3, 4, 5, 6],
|
||||
clearRuleValidity() {},
|
||||
setRuleError() {},
|
||||
setDayInputError() {},
|
||||
hasScheduleRuleOverlap: () => true
|
||||
};
|
||||
vm.runInNewContext(source.slice(start, end) + '\nglobalThis.validateRule = validateScheduleRuleCard;', context);
|
||||
|
||||
assert.equal(context.validateRule({}), true);
|
||||
fields.endDatetime.value = '2026-10-24T09:00';
|
||||
assert.equal(context.validateRule({}), false);
|
||||
});
|
||||
|
||||
test('playlist rows show mute controls for RTMP slides', () => {
|
||||
const model = buildPlaylistFormViewModel(
|
||||
{ id: 22, name: 'Playlist 22' },
|
||||
|
||||
Reference in new issue
Block a user