Release 2.6.13

This commit is contained in:
2026-08-08 21:11:34 +01:00
parent cd8e333afd
commit c5172af62d
7 changed files with 27 additions and 43 deletions
+7 -31
View File
@@ -22,6 +22,7 @@ async function start() {
const PORT = Number(process.env.PLAYER_PORT || 8081);
const PLAYER_PUBLIC_URL = String(process.env.PLAYER_PUBLIC_URL || process.env.PLAYER_BASE_URL || '').trim().replace(/\/$/, '');
const BRIDGE_PUBLIC_URL = String(process.env.BRIDGE_PUBLIC_URL || '').trim().replace(/\/$/, '');
const WEB_INTERNAL_URL = String(process.env.WEB_INTERNAL_URL || '').trim().replace(/\/$/, '');
const isRemotePlayer = Boolean(BRIDGE_PUBLIC_URL);
const PLAYER_INTERNAL_URL = String(isRemotePlayer ? BRIDGE_PUBLIC_URL : (process.env.PLAYER_INTERNAL_URL || PLAYER_PUBLIC_URL || process.env.PLAYER_BASE_URL || '')).trim().replace(/\/$/, '');
const PLAYER_DEVICE_ID = getConfiguredPlayerIdentifier();
@@ -133,7 +134,8 @@ async function start() {
}
async function triggerWebMediaSync() {
if (!isRemotePlayer || !BRIDGE_PUBLIC_URL) {
const syncBaseUrl = WEB_INTERNAL_URL || BRIDGE_PUBLIC_URL;
if (!isRemotePlayer || !syncBaseUrl) {
return false;
}
@@ -144,16 +146,12 @@ async function start() {
};
try {
console.info('[player] Triggering startup media sync', {
playerIdentifier: PLAYER_DEVICE_ID,
bridgeBaseUrl: BRIDGE_PUBLIC_URL
});
const authHeaders = createRequestAuthHeaders({
method: 'POST',
pathname: '/api/internal/sync/player-media',
body: requestBody
});
const response = await fetch(`${BRIDGE_PUBLIC_URL}/api/internal/sync/player-media`, {
const response = await fetch(`${syncBaseUrl}/api/internal/sync/player-media`, {
method: 'POST',
headers: Object.assign({
Accept: 'application/json',
@@ -162,11 +160,6 @@ async function start() {
body: JSON.stringify(requestBody)
});
console.info('[player] Startup media sync response', {
ok: Boolean(response && response.ok),
status: response && response.status ? response.status : null
});
return Boolean(response && response.ok);
} catch (_error) {
console.warn('[player] Startup media sync failed');
@@ -175,7 +168,8 @@ async function start() {
}
async function triggerWebFontSync() {
if (!isRemotePlayer || !BRIDGE_PUBLIC_URL) {
const syncBaseUrl = WEB_INTERNAL_URL || BRIDGE_PUBLIC_URL;
if (!isRemotePlayer || !syncBaseUrl) {
return false;
}
@@ -186,16 +180,12 @@ async function start() {
};
try {
console.info('[player] Triggering startup font sync', {
playerIdentifier: PLAYER_DEVICE_ID,
bridgeBaseUrl: BRIDGE_PUBLIC_URL
});
const authHeaders = createRequestAuthHeaders({
method: 'POST',
pathname: '/api/internal/sync/player-font',
body: requestBody
});
const response = await fetch(`${BRIDGE_PUBLIC_URL}/api/internal/sync/player-font`, {
const response = await fetch(`${syncBaseUrl}/api/internal/sync/player-font`, {
method: 'POST',
headers: Object.assign({
Accept: 'application/json',
@@ -204,11 +194,6 @@ async function start() {
body: JSON.stringify(requestBody)
});
console.info('[player] Startup font sync response', {
ok: Boolean(response && response.ok),
status: response && response.status ? response.status : null
});
return Boolean(response && response.ok);
} catch (_error) {
console.warn('[player] Startup font sync failed');
@@ -257,18 +242,9 @@ async function start() {
response.error = 'Invalid media payload.';
} else {
const bodyBuffer = Buffer.from(bodyBase64, 'base64');
console.info('[player] Writing media file', {
relativePath: relativePath,
filePath: filePath,
bytes: bodyBuffer.length
});
await fs.promises.mkdir(path.dirname(filePath), { recursive: true });
await fs.promises.writeFile(filePath, bodyBuffer);
response.ok = true;
console.info('[player] Media file written', {
relativePath: relativePath,
filePath: filePath
});
}
} else if (command === 'media-delete') {
const relativePath = String(payload.relativePath || payload.filename || '').trim();