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
|
@ -3,7 +3,6 @@ import dialogHelper from '../dialogHelper/dialogHelper';
|
|||
import layoutManager from '../layoutManager';
|
||||
import globalize from '../../scripts/globalize';
|
||||
import * as userSettings from '../../scripts/settings/userSettings';
|
||||
import { ConnectionManager } from 'jellyfin-apiclient';
|
||||
import loading from '../loading/loading';
|
||||
import focusManager from '../focusManager';
|
||||
import dom from '../../scripts/dom';
|
||||
|
@ -15,6 +14,7 @@ import 'material-design-icons-iconfont';
|
|||
import './subtitleeditor.css';
|
||||
import '../../elements/emby-button/emby-button';
|
||||
import '../../assets/css/flexstyles.css';
|
||||
import ServerConnections from '../ServerConnections';
|
||||
|
||||
let currentItem;
|
||||
let hasChanges;
|
||||
|
@ -22,7 +22,7 @@ let hasChanges;
|
|||
function downloadRemoteSubtitles(context, id) {
|
||||
const url = 'Items/' + currentItem.Id + '/RemoteSearch/Subtitles/' + id;
|
||||
|
||||
const apiClient = ConnectionManager.getApiClient(currentItem.ServerId);
|
||||
const apiClient = ServerConnections.getApiClient(currentItem.ServerId);
|
||||
apiClient.ajax({
|
||||
|
||||
type: 'POST',
|
||||
|
@ -56,7 +56,7 @@ function deleteLocalSubtitle(context, index) {
|
|||
const itemId = currentItem.Id;
|
||||
const url = 'Videos/' + itemId + '/Subtitles/' + index;
|
||||
|
||||
const apiClient = ConnectionManager.getApiClient(currentItem.ServerId);
|
||||
const apiClient = ServerConnections.getApiClient(currentItem.ServerId);
|
||||
|
||||
apiClient.ajax({
|
||||
|
||||
|
@ -244,7 +244,7 @@ function searchForSubtitles(context, language) {
|
|||
|
||||
loading.show();
|
||||
|
||||
const apiClient = ConnectionManager.getApiClient(currentItem.ServerId);
|
||||
const apiClient = ServerConnections.getApiClient(currentItem.ServerId);
|
||||
const url = apiClient.getUrl('Items/' + currentItem.Id + '/RemoteSearch/Subtitles/' + language);
|
||||
|
||||
apiClient.getJSON(url).then(function (results) {
|
||||
|
@ -357,7 +357,7 @@ function centerFocus(elem, horiz, on) {
|
|||
function showEditorInternal(itemId, serverId, template) {
|
||||
hasChanges = false;
|
||||
|
||||
const apiClient = ConnectionManager.getApiClient(serverId);
|
||||
const apiClient = ServerConnections.getApiClient(serverId);
|
||||
return apiClient.getItem(apiClient.getCurrentUserId(), itemId).then(function (item) {
|
||||
const dialogOptions = {
|
||||
removeOnClose: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue