1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Cleaning up imageuploader

Adding better error handling with description toast message and removing issues causing the user to have to reload the page
Adds change with relation to jellyfin/jellyfin#247
This commit is contained in:
ViXXoR 2019-01-13 06:38:22 -05:00
parent b7e857127c
commit 12fdec53b4
44 changed files with 98 additions and 2 deletions

View file

@ -74,7 +74,11 @@
return false;
}
if (file.type !== "image/png" && file.type !== "image/jpeg" && file.type !== "image/jpeg") {
if (file.type !== "image/png" && file.type !== "image/x-png" && file.type !== "image/jpeg") {
require(['toast'], function (toast) {
toast(globalize.translate('sharedcomponents#MessageImageFileTypeAllowed'));
});
e.preventDefault();
return false;
}
@ -83,6 +87,13 @@
var dlg = dom.parentWithClass(this, 'dialog');
var imageType = dlg.querySelector('#selectImageType').value;
if (imageType === "None") {
require(["toast"], function(toast) {
toast(globalize.translate("sharedcomponents#MessageImageTypeNotSelected"));
});
e.preventDefault();
return false;
}
connectionManager.getApiClient(currentServerId).uploadItemImage(currentItemId, imageType, file).then(function () {