mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #2150 from thornbill/fix-plugin-init
Fix plugin initialization for dynamic imports
This commit is contained in:
commit
6f1b3c8c9f
2 changed files with 11 additions and 6 deletions
|
@ -89,7 +89,8 @@ import { playbackManager } from './playback/playbackmanager';
|
|||
});
|
||||
} else {
|
||||
console.debug(`Loading plugin (via dynamic import): ${pluginSpec}`);
|
||||
plugin = await import(/* webpackChunkName: "[request]" */ `../plugins/${pluginSpec}`);
|
||||
const pluginResult = await import(/* webpackChunkName: "[request]" */ `../plugins/${pluginSpec}`);
|
||||
plugin = new pluginResult.default;
|
||||
}
|
||||
} else if (pluginSpec.then) {
|
||||
console.debug('Loading plugin (via promise/async function)');
|
||||
|
|
|
@ -204,11 +204,15 @@ import toast from './toast/toast';
|
|||
} else if (action === 'play' || action === 'resume') {
|
||||
const startPositionTicks = parseInt(card.getAttribute('data-positionticks') || '0');
|
||||
|
||||
if (playbackManager.canPlay(item)) {
|
||||
playbackManager.play({
|
||||
ids: [playableItemId],
|
||||
startPositionTicks: startPositionTicks,
|
||||
serverId: serverId
|
||||
});
|
||||
} else {
|
||||
console.warn('Unable to play item', item);
|
||||
}
|
||||
} else if (action === 'queue') {
|
||||
if (playbackManager.isPlaying()) {
|
||||
playbackManager.queue({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue