mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
Fix currentApiClient references
This commit is contained in:
parent
8bc8255a3e
commit
54d71126d9
@ -170,7 +170,7 @@ import './multiSelect.css';
|
||||
}
|
||||
|
||||
function showMenuForSelectedItems(e) {
|
||||
const apiClient = ConnectionManager.currentApiClient();
|
||||
const apiClient = window.ConnectionManager.currentApiClient();
|
||||
|
||||
apiClient.getCurrentUser().then(user => {
|
||||
const menuItems = [];
|
||||
|
@ -869,7 +869,7 @@ class PlaybackManager {
|
||||
const promises = players.filter(displayPlayerIndividually).map(getPlayerTargets);
|
||||
|
||||
return Promise.all(promises).then(function (responses) {
|
||||
return ConnectionManager.currentApiClient().getCurrentUser().then(function (user) {
|
||||
return window.ConnectionManager.currentApiClient().getCurrentUser().then(function (user) {
|
||||
const targets = [];
|
||||
|
||||
targets.push({
|
||||
@ -1367,7 +1367,7 @@ class PlaybackManager {
|
||||
function getSavedMaxStreamingBitrate(apiClient, mediaType) {
|
||||
if (!apiClient) {
|
||||
// This should hopefully never happen
|
||||
apiClient = ConnectionManager.currentApiClient();
|
||||
apiClient = window.ConnectionManager.currentApiClient();
|
||||
}
|
||||
|
||||
const endpointInfo = apiClient.getSavedEndpointInfo() || {};
|
||||
@ -1390,7 +1390,7 @@ class PlaybackManager {
|
||||
const mediaType = playerData.streamInfo ? playerData.streamInfo.mediaType : null;
|
||||
const currentItem = self.currentItem(player);
|
||||
|
||||
const apiClient = currentItem ? ConnectionManager.getApiClient(currentItem.ServerId) : ConnectionManager.currentApiClient();
|
||||
const apiClient = currentItem ? ConnectionManager.getApiClient(currentItem.ServerId) : window.ConnectionManager.currentApiClient();
|
||||
return getSavedMaxStreamingBitrate(apiClient, mediaType);
|
||||
};
|
||||
|
||||
@ -1404,7 +1404,7 @@ class PlaybackManager {
|
||||
const mediaType = playerData.streamInfo ? playerData.streamInfo.mediaType : null;
|
||||
const currentItem = self.currentItem(player);
|
||||
|
||||
const apiClient = currentItem ? ConnectionManager.getApiClient(currentItem.ServerId) : ConnectionManager.currentApiClient();
|
||||
const apiClient = currentItem ? ConnectionManager.getApiClient(currentItem.ServerId) : window.ConnectionManager.currentApiClient();
|
||||
const endpointInfo = apiClient.getSavedEndpointInfo() || {};
|
||||
|
||||
return appSettings.enableAutomaticBitrateDetection(endpointInfo.IsInNetwork, mediaType);
|
||||
|
@ -171,7 +171,7 @@ export default function show (button) {
|
||||
});
|
||||
});
|
||||
|
||||
const apiClient = ConnectionManager.currentApiClient();
|
||||
const apiClient = window.ConnectionManager.currentApiClient();
|
||||
ConnectionManager.user(apiClient).then((user) => {
|
||||
if (syncPlayEnabled) {
|
||||
showLeaveGroupSelection(button, user, apiClient);
|
||||
|
@ -127,7 +127,7 @@ class SyncPlayManager {
|
||||
|
||||
// Report ping
|
||||
if (this.syncEnabled) {
|
||||
const apiClient = ConnectionManager.currentApiClient();
|
||||
const apiClient = window.ConnectionManager.currentApiClient();
|
||||
const sessionId = getActivePlayerId();
|
||||
|
||||
if (!sessionId) {
|
||||
|
@ -113,7 +113,7 @@ class TimeSyncManager {
|
||||
if (!this.poller) {
|
||||
this.poller = setTimeout(() => {
|
||||
this.poller = null;
|
||||
const apiClient = ConnectionManager.currentApiClient();
|
||||
const apiClient = window.ConnectionManager.currentApiClient();
|
||||
const requestSent = new Date();
|
||||
apiClient.getServerTime().then((response) => {
|
||||
const responseReceived = new Date();
|
||||
|
@ -270,7 +270,7 @@ class FavoritesTab {
|
||||
constructor(view, params) {
|
||||
this.view = view;
|
||||
this.params = params;
|
||||
this.apiClient = ConnectionManager.currentApiClient();
|
||||
this.apiClient = window.ConnectionManager.currentApiClient();
|
||||
this.sectionsContainer = view.querySelector('.sections');
|
||||
createSections(this, this.sectionsContainer, this.apiClient);
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ function ScreenSaverManager() {
|
||||
|
||||
this.show = function () {
|
||||
let isLoggedIn;
|
||||
const apiClient = ConnectionManager.currentApiClient();
|
||||
const apiClient = window.ConnectionManager.currentApiClient();
|
||||
|
||||
if (apiClient && apiClient.isLoggedIn()) {
|
||||
isLoggedIn = true;
|
||||
|
@ -21,7 +21,7 @@ class BackdropScreensaver {
|
||||
Limit: 200
|
||||
};
|
||||
|
||||
const apiClient = ConnectionManager.currentApiClient();
|
||||
const apiClient = window.ConnectionManager.currentApiClient();
|
||||
apiClient.getItems(apiClient.getCurrentUserId(), query).then((result) => {
|
||||
if (result.Items.length) {
|
||||
import('../../components/slideshow/slideshow').then(({default: Slideshow}) => {
|
||||
|
@ -328,7 +328,7 @@ class CastPlayer {
|
||||
} else if (message.options && message.options.items && message.options.items.length) {
|
||||
apiClient = ConnectionManager.getApiClient(message.options.items[0].ServerId);
|
||||
} else {
|
||||
apiClient = ConnectionManager.currentApiClient();
|
||||
apiClient = window.ConnectionManager.currentApiClient();
|
||||
}
|
||||
|
||||
message = Object.assign(message, {
|
||||
|
@ -13,7 +13,7 @@ export default class PhotoPlayer {
|
||||
import('../../components/slideshow/slideshow').then(({default: Slideshow}) => {
|
||||
var index = options.startIndex || 0;
|
||||
|
||||
var apiClient = ConnectionManager.currentApiClient();
|
||||
var apiClient = window.ConnectionManager.currentApiClient();
|
||||
apiClient.getCurrentUser().then(function(result) {
|
||||
var newSlideShow = new Slideshow({
|
||||
showTitle: false,
|
||||
|
@ -56,7 +56,7 @@ function getCurrentApiClient(instance) {
|
||||
return ConnectionManager.getApiClient(currentServerId);
|
||||
}
|
||||
|
||||
return ConnectionManager.currentApiClient();
|
||||
return window.ConnectionManager.currentApiClient();
|
||||
}
|
||||
|
||||
function sendCommandByName(instance, name, options) {
|
||||
|
Loading…
Reference in New Issue
Block a user