mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
restore changes
This commit is contained in:
parent
696351fddc
commit
9811b37ac3
2 changed files with 44 additions and 34 deletions
|
@ -605,8 +605,8 @@
|
||||||
|
|
||||||
// This should be outside of the IF
|
// This should be outside of the IF
|
||||||
// But for now, if you change songs but keep the same artist, the backdrop will flicker because in-between songs it clears out the image
|
// But for now, if you change songs but keep the same artist, the backdrop will flicker because in-between songs it clears out the image
|
||||||
if (!browserInfo.safari) {
|
if (!browserInfo.mobile) {
|
||||||
// Exclude from safari because it just doesn't perform well
|
// Exclude from mobile because it just doesn't perform well
|
||||||
Backdrops.setBackdropUrl(page, backdropUrl);
|
Backdrops.setBackdropUrl(page, backdropUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,13 @@
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
// Compatibility
|
||||||
|
window.Logger = {
|
||||||
|
log: function(msg) {
|
||||||
|
console.log(msg);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
var Dashboard = {
|
var Dashboard = {
|
||||||
|
|
||||||
filterHtml: function (html) {
|
filterHtml: function (html) {
|
||||||
|
@ -888,7 +895,6 @@ var Dashboard = {
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
$('.content-primary', page).before(html);
|
$('.content-primary', page).before(html);
|
||||||
Events.trigger(page, 'create');
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1605,18 +1611,20 @@ var AppInfo = {};
|
||||||
apiClient.getDefaultImageQuality = Dashboard.getDefaultImageQuality;
|
apiClient.getDefaultImageQuality = Dashboard.getDefaultImageQuality;
|
||||||
apiClient.normalizeImageOptions = Dashboard.normalizeImageOptions;
|
apiClient.normalizeImageOptions = Dashboard.normalizeImageOptions;
|
||||||
|
|
||||||
$(apiClient).off("websocketmessage", Dashboard.onWebSocketMessageReceived).off('requestfail', Dashboard.onRequestFail);
|
Events.off(apiClient, 'websocketmessage', Dashboard.onWebSocketMessageReceived);
|
||||||
|
Events.on(apiClient, 'websocketmessage', Dashboard.onWebSocketMessageReceived);
|
||||||
|
|
||||||
$(apiClient).on("websocketmessage", Dashboard.onWebSocketMessageReceived).on('requestfail', Dashboard.onRequestFail);
|
Events.off(apiClient, 'requestfail', Dashboard.onRequestFail);
|
||||||
|
Events.on(apiClient, 'requestfail', Dashboard.onRequestFail);
|
||||||
}
|
}
|
||||||
|
|
||||||
//localStorage.clear();
|
//localStorage.clear();
|
||||||
function createConnectionManager(capabilities) {
|
function createConnectionManager(credentialProviderFactory, capabilities) {
|
||||||
|
|
||||||
var credentialKey = Dashboard.isConnectMode() ? null : 'servercredentials4';
|
var credentialKey = Dashboard.isConnectMode() ? null : 'servercredentials4';
|
||||||
var credentialProvider = new MediaBrowser.CredentialProvider(credentialKey);
|
var credentialProvider = new credentialProviderFactory(credentialKey);
|
||||||
|
|
||||||
window.ConnectionManager = new MediaBrowser.ConnectionManager(Logger, credentialProvider, AppInfo.appName, AppInfo.appVersion, AppInfo.deviceName, AppInfo.deviceId, capabilities);
|
window.ConnectionManager = new MediaBrowser.ConnectionManager(credentialProvider, AppInfo.appName, AppInfo.appVersion, AppInfo.deviceName, AppInfo.deviceId, capabilities, window.devicePixelRatio);
|
||||||
|
|
||||||
if (window.location.href.toLowerCase().indexOf('wizardstart.html') != -1) {
|
if (window.location.href.toLowerCase().indexOf('wizardstart.html') != -1) {
|
||||||
window.ConnectionManager.clearData();
|
window.ConnectionManager.clearData();
|
||||||
|
@ -1653,12 +1661,14 @@ var AppInfo = {};
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
var apiClient = new MediaBrowser.ApiClient(Logger, Dashboard.serverAddress(), AppInfo.appName, AppInfo.appVersion, AppInfo.deviceName, AppInfo.deviceId);
|
require(['apiclient'], function(apiClientFactory) {
|
||||||
|
var apiClient = new apiClientFactory(Dashboard.serverAddress(), AppInfo.appName, AppInfo.appVersion, AppInfo.deviceName, AppInfo.deviceId, window.devicePixelRatio);
|
||||||
apiClient.enableAutomaticNetworking = false;
|
apiClient.enableAutomaticNetworking = false;
|
||||||
ConnectionManager.addApiClient(apiClient);
|
ConnectionManager.addApiClient(apiClient);
|
||||||
Dashboard.importCss(apiClient.getUrl('Branding/Css'));
|
Dashboard.importCss(apiClient.getUrl('Branding/Css'));
|
||||||
window.ApiClient = apiClient;
|
window.ApiClient = apiClient;
|
||||||
resolve();
|
resolve();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1784,7 +1794,12 @@ var AppInfo = {};
|
||||||
masonry: bowerPath + '/masonry/dist/masonry.pkgd.min',
|
masonry: bowerPath + '/masonry/dist/masonry.pkgd.min',
|
||||||
humanedate: 'components/humanedate',
|
humanedate: 'components/humanedate',
|
||||||
jQuery: bowerPath + '/jquery/dist/jquery.min',
|
jQuery: bowerPath + '/jquery/dist/jquery.min',
|
||||||
fastclick: bowerPath + '/fastclick/lib/fastclick'
|
fastclick: bowerPath + '/fastclick/lib/fastclick',
|
||||||
|
events: apiClientBowerPath + '/events',
|
||||||
|
credentialprovider: apiClientBowerPath + '/credentials',
|
||||||
|
apiclient: apiClientBowerPath + '/apiclient',
|
||||||
|
connectionmanagerfactory: apiClientBowerPath + '/connectionmanager',
|
||||||
|
connectservice: apiClientBowerPath + '/connectservice'
|
||||||
};
|
};
|
||||||
|
|
||||||
paths.hlsjs = bowerPath + "/hls.js/dist/hls.min";
|
paths.hlsjs = bowerPath + "/hls.js/dist/hls.min";
|
||||||
|
@ -1911,13 +1926,8 @@ var AppInfo = {};
|
||||||
define("fileupload", [apiClientBowerPath + "/fileupload"]);
|
define("fileupload", [apiClientBowerPath + "/fileupload"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
define("connectservice", [apiClientBowerPath + "/connectservice"]);
|
|
||||||
define("apiclient-store", [apiClientBowerPath + "/store"]);
|
define("apiclient-store", [apiClientBowerPath + "/store"]);
|
||||||
define("apiclient-events", [apiClientBowerPath + "/events"]);
|
define("apiclient-deferred", ["legacy/deferred"]);
|
||||||
define("apiclient-logger", [apiClientBowerPath + "/logger"]);
|
|
||||||
define("apiclient-credentials", [apiClientBowerPath + "/credentials"]);
|
|
||||||
define("apiclient-deferred", [apiClientBowerPath + "/deferred"]);
|
|
||||||
define("apiclient", [apiClientBowerPath + "/apiclient"]);
|
|
||||||
define("connectionmanager", [apiClientBowerPath + "/connectionmanager"]);
|
define("connectionmanager", [apiClientBowerPath + "/connectionmanager"]);
|
||||||
|
|
||||||
define("contentuploader", [apiClientBowerPath + "/sync/contentuploader"]);
|
define("contentuploader", [apiClientBowerPath + "/sync/contentuploader"]);
|
||||||
|
@ -1988,6 +1998,7 @@ var AppInfo = {};
|
||||||
define("buttonenabled", ["legacy/buttonenabled"]);
|
define("buttonenabled", ["legacy/buttonenabled"]);
|
||||||
|
|
||||||
var deps = [];
|
var deps = [];
|
||||||
|
deps.push('events');
|
||||||
|
|
||||||
if (!window.fetch) {
|
if (!window.fetch) {
|
||||||
deps.push('fetch');
|
deps.push('fetch');
|
||||||
|
@ -1995,13 +2006,14 @@ var AppInfo = {};
|
||||||
|
|
||||||
deps.push('scripts/mediacontroller');
|
deps.push('scripts/mediacontroller');
|
||||||
deps.push('scripts/globalize');
|
deps.push('scripts/globalize');
|
||||||
deps.push('apiclient-events');
|
|
||||||
|
|
||||||
deps.push('jQuery');
|
deps.push('jQuery');
|
||||||
|
|
||||||
deps.push('paper-drawer-panel');
|
deps.push('paper-drawer-panel');
|
||||||
|
|
||||||
require(deps, function () {
|
require(deps, function (events) {
|
||||||
|
|
||||||
|
window.Events = events;
|
||||||
|
|
||||||
for (var i in hostingAppInfo) {
|
for (var i in hostingAppInfo) {
|
||||||
AppInfo[i] = hostingAppInfo[i];
|
AppInfo[i] = hostingAppInfo[i];
|
||||||
|
@ -2037,19 +2049,19 @@ var AppInfo = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
var deps = [];
|
var deps = [];
|
||||||
|
deps.push('connectionmanagerfactory');
|
||||||
if (AppInfo.isNativeApp && browserInfo.android) {
|
deps.push('credentialprovider');
|
||||||
require(['cordova/android/logging']);
|
|
||||||
}
|
|
||||||
|
|
||||||
deps.push('appstorage');
|
deps.push('appstorage');
|
||||||
deps.push('scripts/mediaplayer');
|
deps.push('scripts/mediaplayer');
|
||||||
deps.push('scripts/appsettings');
|
deps.push('scripts/appsettings');
|
||||||
deps.push('apiclient');
|
|
||||||
deps.push('connectionmanager');
|
|
||||||
deps.push('apiclient-credentials');
|
|
||||||
|
|
||||||
require(deps, function () {
|
require(deps, function (connectionManagerExports, credentialProviderFactory) {
|
||||||
|
|
||||||
|
window.MediaBrowser = window.MediaBrowser || {};
|
||||||
|
for (var i in connectionManagerExports) {
|
||||||
|
MediaBrowser[i] = connectionManagerExports[i];
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: This needs to be deprecated, but it's used heavily
|
// TODO: This needs to be deprecated, but it's used heavily
|
||||||
$.fn.checked = function (value) {
|
$.fn.checked = function (value) {
|
||||||
|
@ -2099,8 +2111,7 @@ var AppInfo = {};
|
||||||
promises.push(getRequirePromise(deps));
|
promises.push(getRequirePromise(deps));
|
||||||
|
|
||||||
promises.push(Globalize.ensure());
|
promises.push(Globalize.ensure());
|
||||||
promises.push(createConnectionManager(capabilities));
|
promises.push(createConnectionManager(credentialProviderFactory, capabilities));
|
||||||
|
|
||||||
|
|
||||||
Promise.all(promises).then(function () {
|
Promise.all(promises).then(function () {
|
||||||
|
|
||||||
|
@ -2422,7 +2433,6 @@ var AppInfo = {};
|
||||||
var initialDependencies = [];
|
var initialDependencies = [];
|
||||||
|
|
||||||
initialDependencies.push('isMobile');
|
initialDependencies.push('isMobile');
|
||||||
initialDependencies.push('apiclient-logger');
|
|
||||||
initialDependencies.push('apiclient-store');
|
initialDependencies.push('apiclient-store');
|
||||||
initialDependencies.push('scripts/extensions');
|
initialDependencies.push('scripts/extensions');
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue