diff --git a/src/bundle.js b/src/bundle.js index 6e687863c..6c162f3db 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 b014b7ae0..bf33d95aa 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;