diff --git a/ApiClient.js b/ApiClient.js index 9a75c12be0..25cbc98779 100644 --- a/ApiClient.js +++ b/ApiClient.js @@ -305,6 +305,42 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi url: url }); }; + + function getRemoteImagePrefix(options) { + + var urlPrefix; + + if (options.artist) { + urlPrefix = "Artists/" + encodeName(options.artist); + delete options.artist; + } + else if (options.person) { + urlPrefix = "Persons/" + encodeName(options.person); + delete options.person; + } + else if (options.genre) { + urlPrefix = "Genres/" + encodeName(options.genre); + delete options.genre; + } + else if (options.musicGenre) { + urlPrefix = "MusicGenres/" + encodeName(options.musicGenre); + delete options.musicGenre; + } + else if (options.gameGenre) { + urlPrefix = "GameGenres/" + encodeName(options.gameGenre); + delete options.gameGenre; + } + else if (options.studio) { + urlPrefix = "Studios/" + encodeName(options.studio); + delete options.studio; + } + else { + urlPrefix = "Items/" + options.itemId; + delete options.itemId; + } + + return urlPrefix; + } self.getAvailableRemoteImages = function (options) { @@ -312,14 +348,9 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi throw new Error("null options"); } - var urlPrefix = "Items/" + options.itemId; + var urlPrefix = getRemoteImagePrefix(options); - var imageType = options.imageType; - - delete options.itemId; - delete options.imageType; - - var url = self.getUrl(urlPrefix + "/RemoteImages/" + imageType, options); + var url = self.getUrl(urlPrefix + "/RemoteImages", options); return self.ajax({ type: "GET", @@ -328,6 +359,22 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi }); }; + self.downloadRemoteImage = function (options) { + + if (!options) { + throw new Error("null options"); + } + + var urlPrefix = getRemoteImagePrefix(options); + + var url = self.getUrl(urlPrefix + "/RemoteImages/Download", options); + + return self.ajax({ + type: "POST", + url: url + }); + }; + /** * Gets the current server status */ diff --git a/dashboard-ui/css/metadataeditor.css b/dashboard-ui/css/metadataeditor.css index 6ee5b156b4..8086497cf7 100644 --- a/dashboard-ui/css/metadataeditor.css +++ b/dashboard-ui/css/metadataeditor.css @@ -29,7 +29,7 @@ .availableImagesList { overflow-y: auto; width: 300px; - height: 500px; + height: 400px; text-align: center; } @@ -49,6 +49,7 @@ background-position: center bottom; background-repeat: no-repeat; background-size: contain; + display: block; } .remotePosterImage { @@ -61,6 +62,16 @@ height: 153px; } +.remoteBannerImage { + width: 272px; + height: 50px; +} + +.remoteDiscImage { + width: 180px; + height: 180px; +} + @media all and (min-width: 500px) { .availableImagesList { @@ -72,6 +83,7 @@ .availableImagesList { width: 500px; + height: 450px; } .editPageSidebar { @@ -89,6 +101,11 @@ float: right; width: 70%; } + + .remoteBannerImage { + width: 450px; + height: 83px; + } } @@ -155,34 +172,6 @@ } } -@media all and (min-width: 1600px) { - - .availableImagesList { - width: 1500px; - } -} - -@media all and (min-width: 1700px) { - - .availableImagesList { - width: 1600px; - } -} - -@media all and (min-width: 1800px) { - - .availableImagesList { - width: 1700px; - } -} - -@media all and (min-width: 1900px) { - - .availableImagesList { - width: 1800px; - } -} - @media all and (min-height: 800px) { .availableImagesList { @@ -196,4 +185,3 @@ height: 700px; } } - diff --git a/dashboard-ui/edititemimages.html b/dashboard-ui/edititemimages.html index 96ca27f262..662249b0bd 100644 --- a/dashboard-ui/edititemimages.html +++ b/dashboard-ui/edititemimages.html @@ -23,7 +23,7 @@
@@ -93,12 +93,20 @@ Close