Release v2.10.3
Publish Docker Image / build-and-push-existing-registry (./build/Dockerfile, web, pulse-signage-web) (push) Successful in 1m13s
Publish Docker Image / build-and-push-existing-registry (./build/Dockerfile.player, player, pulse-signage-player) (push) Successful in 31s

This commit is contained in:
2026-08-29 01:56:45 +01:00
parent 30814f3f46
commit 3f4f57020a
60 changed files with 1075 additions and 523 deletions
+23 -2
View File
@@ -1,3 +1,5 @@
// Refresh data sources and notify only the screens whose rendered data changed.
async function getAffectedScreenSlugs(connection, common, slideMatchKey, sourceId) {
const [slideRows] = await connection.query('SELECT id, content_json FROM c_slides WHERE content_json IS NOT NULL');
const slideIds = [];
@@ -106,6 +108,24 @@ function hasApiSourceChanged(apiSource, responseDetails) {
return normalizeSnapshotValue(apiSource && apiSource.last_response_json) !== normalizeSnapshotValue(responseDetails && responseDetails.responseJson);
}
function isDifferentHour(previousPulledAt, currentPulledAt) {
const previous = new Date(previousPulledAt);
const current = new Date(currentPulledAt);
if (!Number.isFinite(previous.getTime())) {
return false;
}
return previous.getFullYear() !== current.getFullYear()
|| previous.getMonth() !== current.getMonth()
|| previous.getDate() !== current.getDate()
|| previous.getHours() !== current.getHours();
}
function hasWeatherLocationChanged(location, responseDetails, refreshedAt) {
return normalizeSnapshotValue(location && location.last_response_json) !== normalizeSnapshotValue(responseDetails && responseDetails.responseJson)
|| isDifferentHour(location && location.last_pulled_at, refreshedAt);
}
async function refreshApiSource(pool, common, apiSourceOrId, actorId, notifyPlayerScreens) {
const connection = await pool.getConnection();
try {
@@ -169,16 +189,17 @@ async function refreshWeatherLocation(pool, common, weatherLocationOrId, actorId
pullError = String(error && error.message ? error.message : 'Unable to load weather forecast.');
}
const refreshedAt = new Date();
await connection.beginTransaction();
await connection.query(
'UPDATE i_weather_locations SET last_pulled_at = ?, last_pull_error = ?, last_response_json = COALESCE(?, last_response_json), modified_by = ? WHERE id = ?',
[new Date(), pullError || null, result ? result.responseJson : null, actorId, location.id]
[refreshedAt, pullError || null, result ? result.responseJson : null, actorId, location.id]
);
await connection.commit();
if (pullError) {
console.error('[data-source-refresh] Weather location refresh completed with an error for location ' + location.id + ': ' + pullError);
} else if (typeof notifyAffectedScreens === 'function') {
} else if (hasWeatherLocationChanged(location, result, refreshedAt) && typeof notifyPlayerScreens === 'function') {
try {
await notifyAffectedScreens(connection, common, notifyPlayerScreens, 'weather_location_id', location.id);
} catch (notifyError) {