1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
This commit is contained in:
MrTimscampi 2020-08-16 20:24:45 +02:00 committed by vitorsemeano
parent 96eccd2ecd
commit 7d9208e951
143 changed files with 1000 additions and 1008 deletions

View file

@ -1,3 +1,4 @@
let data;
const urlResolver = document.createElement('a');
@ -42,16 +43,9 @@ async function fetchLocal(url, options) {
async function getConfig() {
if (data) return Promise.resolve(data);
try {
const response = await fetchLocal('config.json', {
cache: 'no-cache'
});
if (!response.ok) {
throw new Error('network response was not ok');
}
data = await response.json();
data = await import('../../config.json');
console.dir(data);
return data;
} catch (error) {
console.warn('failed to fetch the web config file:', error);
@ -61,15 +55,9 @@ async function getConfig() {
async function getDefaultConfig() {
try {
const response = await fetchLocal('config.template.json', {
cache: 'no-cache'
});
data = await import('../../config.template.json');
if (!response.ok) {
throw new Error('network response was not ok');
}
data = await response.json();
console.dir(data);
return data;
} catch (error) {
console.error('failed to fetch the default web config file:', error);