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 { registerInitialMediaSyncTask } = require('../src/web/lib/background-tasks/tasks-startup/media-sync');
|
||||
const { registerStartupTasks } = require('../src/web/lib/background-tasks');
|
||||
|
||||
test('initial media sync queues a separate task for each live player', async () => {
|
||||
const queuedTasks = [];
|
||||
@@ -59,4 +60,45 @@ test('initial media sync queues a separate task for each live player', async ()
|
||||
assert.ok(queuedTasks.every(function (task) {
|
||||
return task.key === 'initial-media-sync' && task.title === 'Initial media sync' && task.taskType === 'media-sync';
|
||||
}));
|
||||
});
|
||||
|
||||
test('startup registration queues the shared initial asset sync for a live direct player', async () => {
|
||||
const queuedTasks = [];
|
||||
const liveLastSeenAt = new Date(Date.now() - 10_000).toISOString();
|
||||
|
||||
const startupTasks = registerStartupTasks({
|
||||
pool: {
|
||||
async query() {
|
||||
return [[{
|
||||
identifier: 'player-local',
|
||||
public_base_url: 'http://localhost:8081',
|
||||
internal_base_url: 'http://player:8081',
|
||||
last_seen_at: liveLastSeenAt
|
||||
}]];
|
||||
}
|
||||
},
|
||||
common: {
|
||||
async fetchApiSourcesData() { return { apiSources: [] }; },
|
||||
async fetchRssFeedsData() { return { rssFeeds: [] }; },
|
||||
async fetchWeatherLocationsData() { return { weatherLocations: [] }; }
|
||||
},
|
||||
backgroundTaskQueue: {
|
||||
async enqueueTask(definition) {
|
||||
queuedTasks.push(definition);
|
||||
return definition;
|
||||
}
|
||||
},
|
||||
mediaDir: 'e:/Projects Git/pulse-signage/media',
|
||||
uploadSyncService: {
|
||||
async getPlayerTaskMetadata() { return {}; }
|
||||
}
|
||||
});
|
||||
|
||||
await startupTasks.initialize();
|
||||
|
||||
assert.equal(queuedTasks.length, 1);
|
||||
assert.equal(queuedTasks[0].taskType, 'media-sync');
|
||||
assert.equal(queuedTasks[0].key, 'initial-media-sync');
|
||||
assert.equal(queuedTasks[0].payload.playerIdentifier, 'player-local');
|
||||
assert.equal(queuedTasks[0].payload.mode, 'initial');
|
||||
});
|
||||
Reference in new issue
Block a user