mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Update SyncPlay references to use plugin
This commit is contained in:
parent
641a7c0915
commit
732ef8fdad
9 changed files with 106 additions and 64 deletions
|
@ -1,5 +1,5 @@
|
|||
import { playbackManager } from '../components/playback/playbackmanager';
|
||||
import SyncPlay from '../plugins/syncPlay/core';
|
||||
import { pluginManager } from '../components/pluginManager';
|
||||
import inputManager from '../scripts/inputManager';
|
||||
import focusManager from '../components/focusManager';
|
||||
import { appRouter } from '../components/appRouter';
|
||||
|
@ -7,6 +7,7 @@ import ServerConnections from '../components/ServerConnections';
|
|||
import toast from '../components/toast/toast';
|
||||
import alert from '../components/alert';
|
||||
import Events from '../utils/events.ts';
|
||||
import { PluginType } from '../types/plugin.ts';
|
||||
|
||||
const serverNotifications = {};
|
||||
|
||||
|
@ -140,6 +141,8 @@ function processGeneralCommand(cmd, apiClient) {
|
|||
|
||||
function onMessageReceived(e, msg) {
|
||||
const apiClient = this;
|
||||
const SyncPlay = pluginManager.firstOfType(PluginType.SyncPlay)?.instance;
|
||||
|
||||
if (msg.MessageType === 'Play') {
|
||||
notifyApp();
|
||||
const serverId = apiClient.serverInfo().Id;
|
||||
|
@ -186,9 +189,9 @@ function onMessageReceived(e, msg) {
|
|||
}
|
||||
}
|
||||
} else if (msg.MessageType === 'SyncPlayCommand') {
|
||||
SyncPlay.Manager.processCommand(msg.Data, apiClient);
|
||||
SyncPlay?.Manager.processCommand(msg.Data, apiClient);
|
||||
} else if (msg.MessageType === 'SyncPlayGroupUpdate') {
|
||||
SyncPlay.Manager.processGroupUpdate(msg.Data, apiClient);
|
||||
SyncPlay?.Manager.processGroupUpdate(msg.Data, apiClient);
|
||||
} else {
|
||||
Events.trigger(serverNotifications, msg.MessageType, [apiClient, msg.Data]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue