mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Use connectionManager global
This commit is contained in:
parent
4d540bf9ca
commit
c97d7a6f59
79 changed files with 233 additions and 319 deletions
|
@ -1,7 +1,6 @@
|
|||
import appSettings from 'appSettings';
|
||||
import * as userSettings from 'userSettings';
|
||||
import playbackManager from 'playbackManager';
|
||||
import connectionManager from 'connectionManager';
|
||||
import globalize from 'globalize';
|
||||
import events from 'events';
|
||||
import castSenderApiLoader from 'castSenderApiLoader';
|
||||
|
@ -325,11 +324,11 @@ class CastPlayer {
|
|||
|
||||
let apiClient;
|
||||
if (message.options && message.options.ServerId) {
|
||||
apiClient = connectionManager.getApiClient(message.options.ServerId);
|
||||
apiClient = window.connectionManager.getApiClient(message.options.ServerId);
|
||||
} else if (message.options && message.options.items && message.options.items.length) {
|
||||
apiClient = connectionManager.getApiClient(message.options.items[0].ServerId);
|
||||
apiClient = window.connectionManager.getApiClient(message.options.items[0].ServerId);
|
||||
} else {
|
||||
apiClient = connectionManager.currentApiClient();
|
||||
apiClient = window.connectionManager.currentApiClient();
|
||||
}
|
||||
|
||||
message = Object.assign(message, {
|
||||
|
@ -673,7 +672,7 @@ class ChromecastPlayer {
|
|||
|
||||
playWithCommand(options, command) {
|
||||
if (!options.items) {
|
||||
const apiClient = connectionManager.getApiClient(options.serverId);
|
||||
const apiClient = window.connectionManager.getApiClient(options.serverId);
|
||||
const instance = this;
|
||||
|
||||
return apiClient.getItem(apiClient.getCurrentUserId(), options.ids[0]).then(function (item) {
|
||||
|
@ -985,7 +984,7 @@ class ChromecastPlayer {
|
|||
}
|
||||
|
||||
shuffle(item) {
|
||||
const apiClient = connectionManager.getApiClient(item.ServerId);
|
||||
const apiClient = window.connectionManager.getApiClient(item.ServerId);
|
||||
const userId = apiClient.getCurrentUserId();
|
||||
|
||||
const instance = this;
|
||||
|
@ -998,7 +997,7 @@ class ChromecastPlayer {
|
|||
}
|
||||
|
||||
instantMix(item) {
|
||||
const apiClient = connectionManager.getApiClient(item.ServerId);
|
||||
const apiClient = window.connectionManager.getApiClient(item.ServerId);
|
||||
const userId = apiClient.getCurrentUserId();
|
||||
|
||||
const instance = this;
|
||||
|
@ -1036,7 +1035,7 @@ class ChromecastPlayer {
|
|||
}
|
||||
|
||||
const instance = this;
|
||||
const apiClient = connectionManager.getApiClient(options.serverId);
|
||||
const apiClient = window.connectionManager.getApiClient(options.serverId);
|
||||
|
||||
return getItemsForPlayback(apiClient, {
|
||||
Ids: options.ids.join(',')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue