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

@ -1,7 +1,6 @@
import dom from '../../scripts/dom';
import dialogHelper from '../dialogHelper/dialogHelper';
import loading from '../loading/loading';
import { ConnectionManager } from 'jellyfin-apiclient';
import globalize from '../../scripts/globalize';
import actionsheet from '../actionSheet/actionSheet';
import '../../elements/emby-input/emby-input';
@ -10,13 +9,14 @@ import '../../elements/emby-button/emby-button';
import '../listview/listview.css';
import 'material-design-icons-iconfont';
import '../formdialog.css';
import ServerConnections from '../ServerConnections';
export default class channelMapper {
constructor(options) {
function mapChannel(button, channelId, providerChannelId) {
loading.show();
const providerId = options.providerId;
ConnectionManager.getApiClient(options.serverId).ajax({
ServerConnections.getApiClient(options.serverId).ajax({
type: 'POST',
url: ApiClient.getUrl('LiveTv/ChannelMappings'),
data: JSON.stringify({
@ -59,7 +59,7 @@ export default class channelMapper {
}
function getChannelMappingOptions(serverId, providerId) {
const apiClient = ConnectionManager.getApiClient(serverId);
const apiClient = ServerConnections.getApiClient(serverId);
return apiClient.getJSON(apiClient.getUrl('LiveTv/ChannelMappingOptions', {
providerId: providerId
}));