mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix apiclient imports
This commit is contained in:
parent
7d9208e951
commit
a71b0314d4
71 changed files with 424 additions and 425 deletions
|
@ -1,13 +1,13 @@
|
|||
import * as userSettings from './settings/userSettings';
|
||||
import * as webSettings from './settings/webSettings';
|
||||
import skinManager from './themeManager';
|
||||
import { ConnectionManager, events } from 'jellyfin-apiclient';
|
||||
import { ConnectionManager, Events } from 'jellyfin-apiclient';
|
||||
|
||||
// set the default theme when loading
|
||||
skinManager.setTheme(userSettings.theme());
|
||||
|
||||
// set the saved theme once a user authenticates
|
||||
events.on(ConnectionManager, 'localusersignedin', function (e, user) {
|
||||
Events.on(ConnectionManager, 'localusersignedin', function (e, user) {
|
||||
skinManager.setTheme(userSettings.theme());
|
||||
});
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as userSettings from './settings/userSettings';
|
||||
import { events } from 'jellyfin-apiclient';
|
||||
import { Events } from 'jellyfin-apiclient';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -246,7 +246,7 @@ import { events } from 'jellyfin-apiclient';
|
|||
|
||||
updateCurrentCulture();
|
||||
|
||||
events.on(userSettings, 'change', function (e, name) {
|
||||
Events.on(userSettings, 'change', function (e, name) {
|
||||
if (name === 'language' || name === 'datetimelocale') {
|
||||
updateCurrentCulture();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import dom from './dom';
|
||||
import layoutManager from '../components/layoutManager';
|
||||
import inputManager from './inputManager';
|
||||
import { events } from 'jellyfin-apiclient';
|
||||
import { Events } from 'jellyfin-apiclient';
|
||||
import viewManager from '../components/viewManager/viewManager';
|
||||
import { appRouter } from '../components/appRouter';
|
||||
import { appHost } from '../components/apphost';
|
||||
|
@ -199,8 +199,8 @@ import '../assets/css/flexstyles.css';
|
|||
if (layoutManager.mobile) {
|
||||
initHeadRoom(skinHeader);
|
||||
}
|
||||
events.on(playbackManager, 'playbackstart', onPlaybackStart);
|
||||
events.on(playbackManager, 'playbackstop', onPlaybackStop);
|
||||
Events.on(playbackManager, 'playbackstart', onPlaybackStart);
|
||||
Events.on(playbackManager, 'playbackstop', onPlaybackStop);
|
||||
}
|
||||
|
||||
function onPlaybackStart(e) {
|
||||
|
@ -978,7 +978,7 @@ import '../assets/css/flexstyles.css';
|
|||
|
||||
renderHeader();
|
||||
|
||||
events.on(window.ConnectionManager, 'localusersignedin', function (e, user) {
|
||||
Events.on(window.ConnectionManager, 'localusersignedin', function (e, user) {
|
||||
const currentApiClient = window.ConnectionManager.getApiClient(user.ServerId);
|
||||
|
||||
currentDrawerType = null;
|
||||
|
@ -994,15 +994,15 @@ import '../assets/css/flexstyles.css';
|
|||
});
|
||||
});
|
||||
|
||||
events.on(window.ConnectionManager, 'localusersignedout', function () {
|
||||
Events.on(window.ConnectionManager, 'localusersignedout', function () {
|
||||
currentUser = {};
|
||||
updateUserInHeader();
|
||||
});
|
||||
|
||||
events.on(playbackManager, 'playerchange', updateCastIcon);
|
||||
Events.on(playbackManager, 'playerchange', updateCastIcon);
|
||||
|
||||
events.on(syncPlayManager, 'enabled', onSyncPlayEnabled);
|
||||
events.on(syncPlayManager, 'syncing', onSyncPlaySyncing);
|
||||
Events.on(syncPlayManager, 'enabled', onSyncPlayEnabled);
|
||||
Events.on(syncPlayManager, 'syncing', onSyncPlaySyncing);
|
||||
|
||||
loadNavDrawer();
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import inputManager from './inputManager';
|
|||
import focusManager from '../components/focusManager';
|
||||
import browser from '../scripts/browser';
|
||||
import layoutManager from '../components/layoutManager';
|
||||
import { events } from 'jellyfin-apiclient';
|
||||
import { Events } from 'jellyfin-apiclient';
|
||||
import dom from '../scripts/dom';
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -41,7 +41,7 @@ import dom from '../scripts/dom';
|
|||
if (isMouseIdle) {
|
||||
isMouseIdle = false;
|
||||
removeIdleClasses();
|
||||
events.trigger(self, 'mouseactive');
|
||||
Events.trigger(self, 'mouseactive');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ import dom from '../scripts/dom';
|
|||
if (!isMouseIdle) {
|
||||
isMouseIdle = true;
|
||||
addIdleClasses();
|
||||
events.trigger(self, 'mouseidle');
|
||||
Events.trigger(self, 'mouseidle');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -171,7 +171,7 @@ import dom from '../scripts/dom';
|
|||
|
||||
initMouse();
|
||||
|
||||
events.on(layoutManager, 'modechange', initMouse);
|
||||
Events.on(layoutManager, 'modechange', initMouse);
|
||||
|
||||
/* eslint-enable indent */
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { playbackManager } from '../components/playback/playbackmanager';
|
||||
import syncPlayManager from '../components/syncPlay/syncPlayManager';
|
||||
import { events } from 'jellyfin-apiclient';
|
||||
import { Events } from 'jellyfin-apiclient';
|
||||
import inputManager from '../scripts/inputManager';
|
||||
import focusManager from '../components/focusManager';
|
||||
import { appRouter } from '../components/appRouter';
|
||||
|
@ -191,7 +191,7 @@ function onMessageReceived(e, msg) {
|
|||
} else if (msg.MessageType === 'UserDataChanged') {
|
||||
if (msg.Data.UserId === apiClient.getCurrentUserId()) {
|
||||
for (let i = 0, length = msg.Data.UserDataList.length; i < length; i++) {
|
||||
events.trigger(serverNotifications, 'UserDataChanged', [apiClient, msg.Data.UserDataList[i]]);
|
||||
Events.trigger(serverNotifications, 'UserDataChanged', [apiClient, msg.Data.UserDataList[i]]);
|
||||
}
|
||||
}
|
||||
} else if (msg.MessageType === 'SyncPlayCommand') {
|
||||
|
@ -199,16 +199,16 @@ function onMessageReceived(e, msg) {
|
|||
} else if (msg.MessageType === 'SyncPlayGroupUpdate') {
|
||||
syncPlayManager.processGroupUpdate(msg.Data, apiClient);
|
||||
} else {
|
||||
events.trigger(serverNotifications, msg.MessageType, [apiClient, msg.Data]);
|
||||
Events.trigger(serverNotifications, msg.MessageType, [apiClient, msg.Data]);
|
||||
}
|
||||
}
|
||||
function bindEvents(apiClient) {
|
||||
events.off(apiClient, 'message', onMessageReceived);
|
||||
events.on(apiClient, 'message', onMessageReceived);
|
||||
Events.off(apiClient, 'message', onMessageReceived);
|
||||
Events.on(apiClient, 'message', onMessageReceived);
|
||||
}
|
||||
|
||||
window.ConnectionManager.getApiClients().forEach(bindEvents);
|
||||
events.on(window.ConnectionManager, 'apiclientcreated', function (e, newApiClient) {
|
||||
Events.on(window.ConnectionManager, 'apiclientcreated', function (e, newApiClient) {
|
||||
bindEvents(newApiClient);
|
||||
});
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* eslint-disable indent */
|
||||
import { appStorage, events } from 'jellyfin-apiclient';
|
||||
import { AppStorage, Events } from 'jellyfin-apiclient';
|
||||
|
||||
function getKey(name, userId) {
|
||||
if (userId) {
|
||||
|
@ -80,15 +80,15 @@ import { appStorage, events } from 'jellyfin-apiclient';
|
|||
|
||||
export function set(name, value, userId) {
|
||||
const currentValue = this.get(name, userId);
|
||||
appStorage.setItem(getKey(name, userId), value);
|
||||
AppStorage.setItem(getKey(name, userId), value);
|
||||
|
||||
if (currentValue !== value) {
|
||||
events.trigger(this, 'change', [name]);
|
||||
Events.trigger(this, 'change', [name]);
|
||||
}
|
||||
}
|
||||
|
||||
export function get(name, userId) {
|
||||
return appStorage.getItem(getKey(name, userId));
|
||||
return AppStorage.getItem(getKey(name, userId));
|
||||
}
|
||||
|
||||
/* eslint-enable indent */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import appSettings from './appSettings';
|
||||
import { events } from 'jellyfin-apiclient';
|
||||
import { Events } from 'jellyfin-apiclient';
|
||||
|
||||
function onSaveTimeout() {
|
||||
const self = this;
|
||||
|
@ -77,7 +77,7 @@ export class UserSettings {
|
|||
}
|
||||
|
||||
if (currentValue !== value) {
|
||||
events.trigger(this, 'change', [name]);
|
||||
Events.trigger(this, 'change', [name]);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
@ -96,7 +96,7 @@ function initClient() {
|
|||
import('../components/apphost'),
|
||||
import('./settings/userSettings')
|
||||
])
|
||||
.then(([{ ConnectionManager, Credentials, events }, { appHost} , userSettings]) => {
|
||||
.then(([{ ConnectionManager, Credentials, Events }, { appHost} , userSettings]) => {
|
||||
var credentialProviderInstance = new Credentials();
|
||||
var promises = [appHost.init()];
|
||||
|
||||
|
@ -105,7 +105,7 @@ function initClient() {
|
|||
|
||||
window.ConnectionManager = new ConnectionManager(credentialProviderInstance, appHost.appName(), appHost.appVersion(), appHost.deviceName(), appHost.deviceId(), capabilities);
|
||||
|
||||
bindConnectionManagerEvents(window.ConnectionManager, events, userSettings);
|
||||
bindConnectionManagerEvents(window.ConnectionManager, Events, userSettings);
|
||||
|
||||
if (!AppInfo.isNativeApp) {
|
||||
console.debug('loading ApiClient singleton');
|
||||
|
@ -165,7 +165,7 @@ function initClient() {
|
|||
import('jellyfin-apiclient')
|
||||
])
|
||||
.then(([ globalize, { ConnectionManager, events } ]) => {
|
||||
events.on(ConnectionManager, 'localusersignedin', globalize.updateCurrentCulture);
|
||||
Events.on(ConnectionManager, 'localusersignedin', globalize.updateCurrentCulture);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
import { ConnectionManager, events } from 'jellyfin-apiclient';
|
||||
import { ConnectionManager, Events } from 'jellyfin-apiclient';
|
||||
import serverNotifications from '../scripts/serverNotifications';
|
||||
import globalize from '../scripts/globalize';
|
||||
import '../elements/emby-button/emby-button';
|
||||
|
@ -110,12 +110,12 @@ export default function (options) {
|
|||
|
||||
if (options.mode == 'off') {
|
||||
button.removeEventListener('click', onButtonClick);
|
||||
events.off(serverNotifications, 'ScheduledTasksInfo', onScheduledTasksUpdate);
|
||||
Events.off(serverNotifications, 'ScheduledTasksInfo', onScheduledTasksUpdate);
|
||||
stopInterval();
|
||||
} else {
|
||||
button.addEventListener('click', onButtonClick);
|
||||
pollTasks();
|
||||
startInterval();
|
||||
events.on(serverNotifications, 'ScheduledTasksInfo', onScheduledTasksUpdate);
|
||||
Events.on(serverNotifications, 'ScheduledTasksInfo', onScheduledTasksUpdate);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import dom from '../scripts/dom';
|
||||
import { events } from 'jellyfin-apiclient';
|
||||
import { Events } from 'jellyfin-apiclient';
|
||||
|
||||
function getTouches(e) {
|
||||
return e.changedTouches || e.targetTouches || e.touches;
|
||||
|
@ -73,13 +73,13 @@ class TouchHelper {
|
|||
lastDeltaY = deltaY;
|
||||
|
||||
if (deltaX > swipeXThreshold && Math.abs(deltaY) < swipeXMaxY) {
|
||||
events.trigger(self, 'swiperight', [touchTarget]);
|
||||
Events.trigger(self, 'swiperight', [touchTarget]);
|
||||
} else if (deltaX < (0 - swipeXThreshold) && Math.abs(deltaY) < swipeXMaxY) {
|
||||
events.trigger(self, 'swipeleft', [touchTarget]);
|
||||
Events.trigger(self, 'swipeleft', [touchTarget]);
|
||||
} else if ((deltaY < (0 - swipeYThreshold) || thresholdYMet) && Math.abs(deltaX) < swipeXMaxY) {
|
||||
thresholdYMet = true;
|
||||
|
||||
events.trigger(self, 'swipeup', [touchTarget, {
|
||||
Events.trigger(self, 'swipeup', [touchTarget, {
|
||||
deltaY: deltaY,
|
||||
deltaX: deltaX,
|
||||
clientX: clientX,
|
||||
|
@ -90,7 +90,7 @@ class TouchHelper {
|
|||
} else if ((deltaY > swipeYThreshold || thresholdYMet) && Math.abs(deltaX) < swipeXMaxY) {
|
||||
thresholdYMet = true;
|
||||
|
||||
events.trigger(self, 'swipedown', [touchTarget, {
|
||||
Events.trigger(self, 'swipedown', [touchTarget, {
|
||||
deltaY: deltaY,
|
||||
deltaX: deltaX,
|
||||
clientX: clientX,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue