diff --git a/dashboard-ui/bower_components/emby-webcomponents/.bower.json b/dashboard-ui/bower_components/emby-webcomponents/.bower.json index 472dc0d36b..6ae86cefd5 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/.bower.json +++ b/dashboard-ui/bower_components/emby-webcomponents/.bower.json @@ -14,12 +14,12 @@ }, "devDependencies": {}, "ignore": [], - "version": "1.4.132", - "_release": "1.4.132", + "version": "1.4.135", + "_release": "1.4.135", "_resolution": { "type": "version", - "tag": "1.4.132", - "commit": "4af41910495a11c5f3fdfcdc9821c1944d4da439" + "tag": "1.4.135", + "commit": "769b3fed535db71b82c65e113ac39505078a2a82" }, "_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_target": "^1.2.0", diff --git a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/chaptercardbuilder.js b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/chaptercardbuilder.js index 0d7d4eebff..6d53561450 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/chaptercardbuilder.js +++ b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/chaptercardbuilder.js @@ -1,4 +1,4 @@ -define(['datetime', 'imageLoader', 'itemShortcuts', 'connectionManager'], function (datetime, imageLoader, itemShortcuts, connectionManager) { +define(['datetime', 'imageLoader', 'connectionManager'], function (datetime, imageLoader, connectionManager) { function buildChapterCardsHtml(item, chapters, options) { @@ -9,12 +9,12 @@ define(['datetime', 'imageLoader', 'itemShortcuts', 'connectionManager'], functi return i.Type == 'Video'; })[0] || {}; - var shape = 'backdropCard'; + var shape = (options.backdropShape || 'backdrop') + 'Card'; if (videoStream.Width && videoStream.Height) { if ((videoStream.Width / videoStream.Height) <= 1.34) { - shape = 'squareCard'; + shape = (options.squareShape || 'square') + 'Card'; } } @@ -121,9 +121,6 @@ define(['datetime', 'imageLoader', 'itemShortcuts', 'connectionManager'], functi options.itemsContainer.innerHTML = html; imageLoader.lazyChildren(options.itemsContainer); - - itemShortcuts.off(options.itemsContainer); - itemShortcuts.on(options.itemsContainer); } return { diff --git a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/peoplecardbuilder.js b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/peoplecardbuilder.js index dd6accc7eb..ead14f49c4 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/peoplecardbuilder.js +++ b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/peoplecardbuilder.js @@ -1,8 +1,8 @@ -define(['imageLoader', 'itemShortcuts'], function (imageLoader, itemShortcuts) { +define(['imageLoader', 'itemShortcuts', 'connectionManager'], function (imageLoader, itemShortcuts, connectionManager) { function buildPeopleCardsHtml(people, options) { - var className = 'card portraitCard personCard'; + var className = 'card ' + (options.shape || 'portrait') + 'Card personCard'; if (options.block || options.rows) { className += ' block'; @@ -12,6 +12,7 @@ define(['imageLoader', 'itemShortcuts'], function (imageLoader, itemShortcuts) { var itemsInRow = 0; var serverId = options.serverId; + var apiClient = connectionManager.getApiClient(serverId); for (var i = 0, length = people.length; i < length; i++) { @@ -21,7 +22,7 @@ define(['imageLoader', 'itemShortcuts'], function (imageLoader, itemShortcuts) { var person = people[i]; - html += buildPersonCard(person, serverId, options, className); + html += buildPersonCard(person, apiClient, serverId, options, className); itemsInRow++; if (options.rows && itemsInRow >= options.rows) { @@ -33,11 +34,26 @@ define(['imageLoader', 'itemShortcuts'], function (imageLoader, itemShortcuts) { return html; } - function buildPersonCard(person, serverId, options, className) { + function getImgUrl(person, maxWidth, apiClient) { + + if (person.PrimaryImageTag) { + + return apiClient.getScaledImageUrl(person.Id, { + + maxWidth: maxWidth, + tag: person.PrimaryImageTag, + type: "Primary" + }); + } + + return null; + } + + function buildPersonCard(person, apiClient, serverId, options, className) { className += " itemAction scalableCard"; - var imgUrl = person.images ? person.images.primary : ''; + var imgUrl = getImgUrl(person, options.width, apiClient); var cardImageContainerClass = 'cardImageContainer'; if (options.coverImage) { @@ -79,12 +95,12 @@ define(['imageLoader', 'itemShortcuts'], function (imageLoader, itemShortcuts) { function buildPeopleCards(items, options) { - // Abort if the container has been disposed - if (!document.body.contains(options.parentContainer)) { - return; - } - if (options.parentContainer) { + // Abort if the container has been disposed + if (!document.body.contains(options.parentContainer)) { + return; + } + if (items.length) { options.parentContainer.classList.remove('hide'); } else { diff --git a/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js b/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js index 3cbc378ed5..11eb5bae32 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js +++ b/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js @@ -87,7 +87,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', }); } - if (isMobileApp && options.identify !== false) { + if (options.identify !== false) { if (itemHelper.canIdentify(user, item.Type)) { commands.push({ name: globalize.translate('sharedcomponents#Identify'), @@ -298,7 +298,6 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', { require(['subtitleEditor'], function (subtitleEditor) { - var serverId = apiClient.serverInfo().Id; subtitleEditor.show(itemId, serverId).then(getResolveFunction(resolve, id, true), getResolveFunction(resolve, id)); }); break; @@ -318,9 +317,9 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', } case 'identify': { - require(['components/itemidentifier/itemidentifier'], function (itemidentifier) { + require(['itemIdentifier'], function (itemIdentifier) { - itemidentifier.show(itemId).then(getResolveFunction(resolve, id, true), getResolveFunction(resolve, id)); + itemIdentifier.show(itemId, serverId).then(getResolveFunction(resolve, id, true), getResolveFunction(resolve, id)); }); break; } diff --git a/dashboard-ui/components/itemidentifier/itemidentifier.js b/dashboard-ui/bower_components/emby-webcomponents/itemidentifier/itemidentifier.js similarity index 88% rename from dashboard-ui/components/itemidentifier/itemidentifier.js rename to dashboard-ui/bower_components/emby-webcomponents/itemidentifier/itemidentifier.js index 630fb82b3e..988def9855 100644 --- a/dashboard-ui/components/itemidentifier/itemidentifier.js +++ b/dashboard-ui/bower_components/emby-webcomponents/itemidentifier/itemidentifier.js @@ -1,12 +1,17 @@ -define(['dialogHelper', 'loading', 'cardBuilder', 'emby-input', 'emby-checkbox', 'paper-icon-button-light'], function (dialogHelper, loading, cardBuilder) { +define(['dialogHelper', 'loading', 'cardBuilder', 'connectionManager', 'require', 'globalize', 'emby-input', 'emby-checkbox', 'paper-icon-button-light'], function (dialogHelper, loading, cardBuilder, connectionManager, require, globalize) { var currentItem; var currentItemType; + var currentServerId; var currentResolve; var currentReject; var hasChanges = false; var currentSearchResult; + function getApiClient() { + return connectionManager.getApiClient(currentServerId); + } + function searchForIdentificationResults(page) { var lookupInfo = { @@ -44,7 +49,7 @@ if (!hasId && !lookupInfo.Name) { require(['toast'], function (toast) { - toast(Globalize.translate('MessagePleaseEnterNameOrId')); + toast(globalize.translate('MessagePleaseEnterNameOrId')); }); return; } @@ -60,9 +65,11 @@ loading.show(); - ApiClient.ajax({ + var apiClient = getApiClient(); + + apiClient.ajax({ type: "POST", - url: ApiClient.getUrl("Items/RemoteSearch/" + currentItemType), + url: apiClient.getUrl("Items/RemoteSearch/" + currentItemType), data: JSON.stringify(lookupInfo), contentType: "application/json", dataType: 'json' @@ -203,7 +210,9 @@ } function getSearchImageDisplayUrl(url, provider) { - return ApiClient.getUrl("Items/RemoteSearch/Image", { imageUrl: url, ProviderName: provider }); + var apiClient = getApiClient(); + + return apiClient.getUrl("Items/RemoteSearch/Image", { imageUrl: url, ProviderName: provider }); } function submitIdentficationResult(page) { @@ -214,9 +223,11 @@ ReplaceAllImages: page.querySelector('#chkIdentifyReplaceImages').checked }; - ApiClient.ajax({ + var apiClient = getApiClient(); + + apiClient.ajax({ type: "POST", - url: ApiClient.getUrl("Items/RemoteSearch/Apply/" + currentItem.Id, options), + url: apiClient.getUrl("Items/RemoteSearch/Apply/" + currentItem.Id, options), data: JSON.stringify(currentSearchResult), contentType: "application/json" @@ -251,7 +262,7 @@ html += '