Plex: try the server's LAN address first, allow a manual address
build-container / build (push) Successful in 2m6s
build-container / build (push) Successful in 2m6s
Connecting through plex.direct names failed from the container (DNS and hairpin NAT). Try http://<lan-ip>:<port> first, verify the server's machine identifier before sending the token, and let the user type an address when discovery fails. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4456c03cd0
commit
732b73677b
2 files changed
+37
-12
No files matched your search
+13
-2
@@ -550,11 +550,22 @@ async function plexPickServer() {
|
||||
if (!servers.length) { v.innerHTML = '<div class="wrap"><h1>Music</h1><p class="err">No Plex servers found on this account.</p></div>'; return; }
|
||||
v.innerHTML = `<div class="wrap"><h1>Music</h1><p class="sub">Choose a server</p><div class="list">${servers.map(s => `
|
||||
<button class="row" data-id="${esc(s.id)}"><span class="ic" style="background:#e5a00d">${icon('music')}</span>
|
||||
<span class="grow"><b>${esc(s.name)}</b><small>${s.owned ? 'Yours' : 'Shared with you'}</small></span>${icon('chev', 'chev')}</button>`).join('')}</div><div class="err" id="pe"></div></div>`;
|
||||
<span class="grow"><b>${esc(s.name)}</b><small>${s.owned ? 'Yours' : 'Shared with you'}</small></span>${icon('chev', 'chev')}</button>`).join('')}</div><div class="err" id="pe"></div><div id="pm"></div></div>`;
|
||||
v.querySelectorAll('button.row').forEach(b => b.onclick = async () => {
|
||||
b.disabled = true; $('#pe').textContent = '';
|
||||
try { await jfetch('/api/plex/server', { method: 'POST', body: JSON.stringify({ id: b.dataset.id }) }); px.sec = null; route(); }
|
||||
catch (e) { b.disabled = false; $('#pe').textContent = e.message; }
|
||||
catch (e) {
|
||||
b.disabled = false; $('#pe').textContent = e.message;
|
||||
// Offer a hand-typed address (e.g. the server's LAN address) when automatic discovery fails.
|
||||
$('#pm').innerHTML = `<p class="sub">Know the server's address? Enter it (for example <b>http://192.168.1.10:32400</b>).</p>
|
||||
<form id="pf2"><input type="url" id="pu" placeholder="http://192.168.1.10:32400" autocomplete="off" autocapitalize="off" required>
|
||||
<div class="bar"><button class="btn">Try this address</button></div></form>`;
|
||||
$('#pf2').onsubmit = async ev => {
|
||||
ev.preventDefault(); $('#pe').textContent = '';
|
||||
try { await jfetch('/api/plex/server', { method: 'POST', body: JSON.stringify({ id: b.dataset.id, uri: $('#pu').value.trim() }) }); px.sec = null; route(); }
|
||||
catch (e2) { $('#pe').textContent = e2.message; }
|
||||
};
|
||||
}
|
||||
});
|
||||
} catch (e) { if (e.status === 401) return plexSignIn(); v.innerHTML = `<div class="wrap"><h1>Music</h1><p class="err">${esc(e.message)}</p></div>`; }
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user