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 {
|
} else {
|
||||||
console.debug(`Loading plugin (via dynamic import): ${pluginSpec}`);
|
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) {
|
} else if (pluginSpec.then) {
|
||||||
console.debug('Loading plugin (via promise/async function)');
|
console.debug('Loading plugin (via promise/async function)');
|
||||||
|
|
|
@ -204,11 +204,15 @@ import toast from './toast/toast';
|
||||||
} else if (action === 'play' || action === 'resume') {
|
} else if (action === 'play' || action === 'resume') {
|
||||||
const startPositionTicks = parseInt(card.getAttribute('data-positionticks') || '0');
|
const startPositionTicks = parseInt(card.getAttribute('data-positionticks') || '0');
|
||||||
|
|
||||||
playbackManager.play({
|
if (playbackManager.canPlay(item)) {
|
||||||
ids: [playableItemId],
|
playbackManager.play({
|
||||||
startPositionTicks: startPositionTicks,
|
ids: [playableItemId],
|
||||||
serverId: serverId
|
startPositionTicks: startPositionTicks,
|
||||||
});
|
serverId: serverId
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.warn('Unable to play item', item);
|
||||||
|
}
|
||||||
} else if (action === 'queue') {
|
} else if (action === 'queue') {
|
||||||
if (playbackManager.isPlaying()) {
|
if (playbackManager.isPlaying()) {
|
||||||
playbackManager.queue({
|
playbackManager.queue({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue