diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index aa3ec707e3..2eae7e6933 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -34,6 +34,7 @@ - [Ryan Hartzell](https://github.com/ryan-hartzell) - [Thibault Nocchi](https://github.com/ThibaultNocchi) - [MrTimscampi](https://github.com/MrTimscampi) + - [Sarab Singh](https://github.com/sarab97) # Emby Contributors diff --git a/src/components/photoplayer/plugin.js b/src/components/photoplayer/plugin.js index 4ebdbbd6d2..06d2e3b391 100644 --- a/src/components/photoplayer/plugin.js +++ b/src/components/photoplayer/plugin.js @@ -21,18 +21,24 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa var index = options.startIndex || 0; - var newSlideShow = new slideshow({ - showTitle: false, - cover: false, - items: options.items, - startIndex: index, - interval: 11000, - interactive: true + var apiClient = connectionManager.currentApiClient(); + + apiClient.getCurrentUser().then(function(result) { + + var newSlideShow = new slideshow({ + showTitle: false, + cover: false, + items: options.items, + startIndex: index, + interval: 11000, + interactive: true, + user: result + }); + + newSlideShow.show(); + + resolve(); }); - - newSlideShow.show(); - - resolve(); }); }); }; diff --git a/src/components/slideshow/slideshow.js b/src/components/slideshow/slideshow.js index 48ccee21c8..715e16325a 100644 --- a/src/components/slideshow/slideshow.js +++ b/src/components/slideshow/slideshow.js @@ -66,14 +66,14 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f * @param {object} item - Item used to generate the image URL. * @returns {string} URL of the item's image. */ - function getImgUrl(item) { + function getImgUrl(item, user) { var apiClient = connectionManager.getApiClient(item.ServerId); var imageOptions = {}; if (item.BackdropImageTags && item.BackdropImageTags.length) { return getBackdropImageUrl(item, imageOptions, apiClient); } else { - if (item.MediaType === 'Photo') { + if (item.MediaType === 'Photo' && user && user.Policy.EnableContentDownloading) { return apiClient.getItemDownloadUrl(item.Id); } imageOptions.type = "Primary"; @@ -155,7 +155,7 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f html += '
'; if (actionButtonsOnTop) { - if (appHost.supports('filedownload')) { + if (appHost.supports('filedownload') && options.user && options.user.Policy.EnableContentDownloading) { html += getIcon('file_download', 'btnDownload slideshowButton', true); } if (appHost.supports('sharing')) { @@ -169,7 +169,7 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f html += '
'; html += getIcon('play_arrow', 'btnSlideshowPause slideshowButton', true, true); - if (appHost.supports('filedownload')) { + if (appHost.supports('filedownload') && options.user && options.user.Policy.EnableContentDownloading) { html += getIcon('file_download', 'btnDownload slideshowButton', true); } if (appHost.supports('sharing')) { @@ -312,7 +312,7 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f */ function getSwiperSlideHtmlFromItem(item) { return getSwiperSlideHtmlFromSlide({ - originalImage: getImgUrl(item), + originalImage: getImgUrl(item, currentOptions.user), //title: item.Name, //description: item.Overview Id: item.Id,