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:
parent
923d53bb71
commit
5071aedcea
81 changed files with 446 additions and 397 deletions
|
@ -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();
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue