mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
wizard takes highest priority when selecting a server
This commit is contained in:
parent
e60f01b3a3
commit
d4c8d1a334
1 changed files with 11 additions and 4 deletions
|
@ -18,11 +18,13 @@ export async function serverAddress() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (current) return Promise.resolve(current);
|
// TODO this makes things faster but it also blocks the wizard in some scenarios
|
||||||
|
// if (current) return Promise.resolve(current);
|
||||||
|
|
||||||
const urls = [];
|
const urls = [];
|
||||||
urls.push(window.location.origin);
|
urls.push(window.location.origin);
|
||||||
urls.push(`${window.location.protocol}//${window.location.hostname}:8096`);
|
urls.push(`https://${window.location.hostname}:8920`);
|
||||||
|
urls.push(`http://${window.location.hostname}:8096`);
|
||||||
urls.push(...await webSettings.getServers());
|
urls.push(...await webSettings.getServers());
|
||||||
|
|
||||||
const promises = urls.map(url => {
|
const promises = urls.map(url => {
|
||||||
|
@ -32,8 +34,13 @@ export async function serverAddress() {
|
||||||
});
|
});
|
||||||
|
|
||||||
return Promise.all(promises).then(responses => {
|
return Promise.all(promises).then(responses => {
|
||||||
return responses.find(response => response && response.ok);
|
responses = responses.filter(response => response && response.ok);
|
||||||
}).then(response => response.url.replace('/System/Info/Public', '')).catch(error => {
|
return Promise.all(responses.map(response => response.json()));
|
||||||
|
}).then(configs => {
|
||||||
|
const selection = configs.find(config => !config.StartupWizardCompleted)
|
||||||
|
if (!selection) selection = configs[0];
|
||||||
|
return Promise.resolve(selection.LocalAddress);
|
||||||
|
}).catch(error => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue