Release v2.10.3
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
// Commands and synchronization actions forwarded from the web app to players.
|
||||
|
||||
const { createRequestAuthHeaders } = require('#src/request-auth');
|
||||
const { getConfiguredPlayerIdentifier } = require('#src/data/player-registry');
|
||||
|
||||
@@ -215,6 +217,31 @@ function createPlayerActionService(options) {
|
||||
return forwardPlayerCommandToBaseUrl(resolvedPlayerInternalBaseUrl, slug, commandOrPayload, connectionId);
|
||||
}
|
||||
|
||||
async function resolvePlayerBaseUrlForPublicUrl(playerPublicBaseUrl) {
|
||||
const normalizedPublicBaseUrl = normalizeBaseUrl(playerPublicBaseUrl);
|
||||
if (!normalizedPublicBaseUrl) {
|
||||
return '';
|
||||
}
|
||||
|
||||
try {
|
||||
const players = await fetchPlayerRegistrations(pool);
|
||||
const matchedPlayer = (Array.isArray(players) ? players : []).find(function (player) {
|
||||
return normalizeBaseUrl(player && player.public_base_url) === normalizedPublicBaseUrl;
|
||||
});
|
||||
const registeredInternalBaseUrl = normalizeBaseUrl(matchedPlayer && matchedPlayer.internal_base_url);
|
||||
if (registeredInternalBaseUrl) {
|
||||
return registeredInternalBaseUrl;
|
||||
}
|
||||
} catch (_error) {
|
||||
}
|
||||
|
||||
if (isLocalLikeBaseUrl(normalizedPublicBaseUrl) && configuredPlayerInternalBaseUrl) {
|
||||
return configuredPlayerInternalBaseUrl;
|
||||
}
|
||||
|
||||
return normalizedPublicBaseUrl;
|
||||
}
|
||||
|
||||
async function forwardAnnouncementRefresh(slug) {
|
||||
const resolvedPlayerInternalBaseUrl = await getPlayerInternalBaseUrl();
|
||||
const targetBaseUrls = Array.from(new Set([
|
||||
@@ -367,6 +394,7 @@ function createPlayerActionService(options) {
|
||||
|
||||
return {
|
||||
forwardPlayerCommand: forwardPlayerCommand,
|
||||
resolvePlayerBaseUrlForPublicUrl: resolvePlayerBaseUrlForPublicUrl,
|
||||
forwardAnnouncementRefresh: forwardAnnouncementRefresh,
|
||||
getScreenConnections: getScreenConnections,
|
||||
forwardPlayerCommandToBaseUrl: forwardPlayerCommandToBaseUrl,
|
||||
|
||||
Reference in New Issue
Block a user