From 8e337da01db943acc57d9861634828f3126de4b0 Mon Sep 17 00:00:00 2001 From: MrTimscampi Date: Sat, 2 May 2020 21:40:43 +0200 Subject: [PATCH] Pass ApiClientFactory instead of API client module --- src/bundle.js | 4 ++++ src/scripts/site.js | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/bundle.js b/src/bundle.js index 6e687863c2..6c162f3db1 100644 --- a/src/bundle.js +++ b/src/bundle.js @@ -157,6 +157,10 @@ _define("headroom", function () { // apiclient var apiclient = require("jellyfin-apiclient"); +_define("apiclient", function () { + return apiclient.apiclient; +}) + _define("events", function () { return apiclient.Events; }); diff --git a/src/scripts/site.js b/src/scripts/site.js index b014b7ae04..bf33d95aa7 100644 --- a/src/scripts/site.js +++ b/src/scripts/site.js @@ -288,10 +288,10 @@ var AppInfo = {}; if (!AppInfo.isNativeApp) { console.debug("loading ApiClient singleton"); - return require(["apiclient"], function (apiClientModule) { + return require(["apiclient"], function (apiClientFactory) { console.debug("creating ApiClient singleton"); - var apiClient = new apiClientModule.ApiClient(Dashboard.serverAddress(), apphost.appName(), apphost.appVersion(), apphost.deviceName(), apphost.deviceId()); + var apiClient = new apiClientFactory(Dashboard.serverAddress(), apphost.appName(), apphost.appVersion(), apphost.deviceName(), apphost.deviceId()); apiClient.enableAutomaticNetworking = false; apiClient.manualAddressOnly = true;