1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

extracted connectionManager from site.js

new module ServerConnections for ConnectionManager
all code adapted to this new module
removed Events and ConnectionManager from eslintrc
This commit is contained in:
vitorsemeano 2020-10-17 19:08:56 +01:00
parent 923d53bb71
commit 5071aedcea
81 changed files with 446 additions and 397 deletions

View file

@ -9,8 +9,9 @@ import dom from '../../scripts/dom';
import loading from '../../components/loading/loading';
import focusManager from '../../components/focusManager';
import serverNotifications from '../../scripts/serverNotifications';
import { ConnectionManager, Events } from 'jellyfin-apiclient';
import { Events } from 'jellyfin-apiclient';
import 'webcomponents.js/webcomponents-lite';
import ServerConnections from '../../components/ServerConnections';
/* eslint-disable indent */
@ -103,7 +104,7 @@ import 'webcomponents.js/webcomponents-lite';
}
const serverId = el.getAttribute('data-serverid');
const apiClient = ConnectionManager.getApiClient(serverId);
const apiClient = ServerConnections.getApiClient(serverId);
loading.show();

View file

@ -1,7 +1,8 @@
import serverNotifications from '../../scripts/serverNotifications';
import { ConnectionManager, Events } from 'jellyfin-apiclient';
import { Events } from 'jellyfin-apiclient';
import globalize from '../../scripts/globalize';
import EmbyButtonPrototype from '../../elements/emby-button/emby-button';
import ServerConnections from '../../components/ServerConnections';
/* eslint-disable indent */
@ -23,7 +24,7 @@ import EmbyButtonPrototype from '../../elements/emby-button/emby-button';
const button = this;
const id = button.getAttribute('data-id');
const serverId = button.getAttribute('data-serverid');
const apiClient = ConnectionManager.getApiClient(serverId);
const apiClient = ServerConnections.getApiClient(serverId);
if (!button.classList.contains('playstatebutton-played')) {
apiClient.markPlayed(apiClient.getCurrentUserId(), id, new Date());

View file

@ -1,7 +1,8 @@
import serverNotifications from '../../scripts/serverNotifications';
import { ConnectionManager, Events } from 'jellyfin-apiclient';
import { Events } from 'jellyfin-apiclient';
import globalize from '../../scripts/globalize';
import EmbyButtonPrototype from '../emby-button/emby-button';
import ServerConnections from '../../components/ServerConnections';
/* eslint-disable indent */
@ -27,7 +28,7 @@ import EmbyButtonPrototype from '../emby-button/emby-button';
const button = this;
const id = button.getAttribute('data-id');
const serverId = button.getAttribute('data-serverid');
const apiClient = ConnectionManager.getApiClient(serverId);
const apiClient = ServerConnections.getApiClient(serverId);
let likes = this.getAttribute('data-likes');
const isFavorite = this.getAttribute('data-isfavorite') === 'true';