mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Use async for loadPlugins
This commit is contained in:
parent
741c612920
commit
ab0fa6cfe6
1 changed files with 24 additions and 23 deletions
|
@ -120,10 +120,11 @@ function loadFonts() {
|
|||
}
|
||||
}
|
||||
|
||||
function loadPlugins() {
|
||||
async function loadPlugins() {
|
||||
console.groupCollapsed('loading installed plugins');
|
||||
console.dir(pluginManager);
|
||||
return getPlugins().then(function (list) {
|
||||
|
||||
let list = await getPlugins();
|
||||
if (!appHost.supports('remotecontrol')) {
|
||||
// Disable remote player plugins if not supported
|
||||
list = list.filter(plugin => !plugin.startsWith('sessionPlayer')
|
||||
|
@ -138,15 +139,15 @@ function loadPlugins() {
|
|||
list = list.concat(window.NativeShell.getPlugins());
|
||||
}
|
||||
|
||||
Promise.all(list.map(plugin => pluginManager.loadPlugin(plugin)))
|
||||
.then(() => console.debug('finished loading plugins'))
|
||||
.catch(e => console.warn('failed loading plugins', e))
|
||||
.finally(() => {
|
||||
try {
|
||||
await Promise.all(list.map(plugin => pluginManager.loadPlugin(plugin)));
|
||||
console.debug('finished loading plugins');
|
||||
} catch (e) {
|
||||
console.warn('failed loading plugins', e);
|
||||
}
|
||||
|
||||
console.groupEnd('loading installed plugins');
|
||||
packageManager.init();
|
||||
})
|
||||
;
|
||||
});
|
||||
}
|
||||
|
||||
function loadPlatformFeatures() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue