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
@@ -4,6 +4,7 @@ const assert = require('node:assert/strict');
|
||||
require('../src/common');
|
||||
|
||||
const { registerInitialFontSyncTask } = require('../src/web/lib/background-tasks/tasks-startup/font-sync');
|
||||
const { registerFontSyncTask } = require('../src/web/lib/background-tasks/tasks-adhoc/font-sync');
|
||||
|
||||
test('initial font sync queues a separate task for each live player', async () => {
|
||||
const queuedTasks = [];
|
||||
@@ -59,4 +60,38 @@ test('initial font sync queues a separate task for each live player', async () =
|
||||
assert.ok(queuedTasks.every(function (task) {
|
||||
return task.key === 'initial-font-sync' && task.title === 'Initial font sync' && task.taskType === 'font-sync';
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
test('font sync task fails when a required player upload is unsuccessful', async () => {
|
||||
let handler = null;
|
||||
registerFontSyncTask({
|
||||
backgroundTaskQueue: {
|
||||
setTaskHandler(taskType, taskHandler) {
|
||||
assert.equal(taskType, 'font-sync');
|
||||
handler = taskHandler;
|
||||
}
|
||||
},
|
||||
uploadSyncService: {
|
||||
async pushUploadFileToPlayer() { return false; },
|
||||
async removeUploadFileFromPlayer() { return false; }
|
||||
}
|
||||
});
|
||||
|
||||
await assert.rejects(handler({
|
||||
payload: {
|
||||
uploadDir: 'media',
|
||||
playerIdentifier: 'player-local',
|
||||
requireSuccess: true,
|
||||
operations: [{ type: 'put', uploadPath: '/media/assets/fonts/test.ttf' }]
|
||||
}
|
||||
}), /Unable to synchronize \/media\/assets\/fonts\/test\.ttf to player player-local\./);
|
||||
|
||||
await assert.rejects(handler({
|
||||
payload: {
|
||||
uploadDir: 'media',
|
||||
playerIdentifier: 'player-local',
|
||||
requireSuccess: true,
|
||||
operations: [{ type: 'delete', uploadPath: '/media/assets/fonts/old.ttf' }]
|
||||
}
|
||||
}), /Unable to remove \/media\/assets\/fonts\/old\.ttf from player player-local\./);
|
||||
});
|
||||
Reference in new issue
Block a user