mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #1166 from sarab97/downloadbutton
Download button fix on photos slideshow
This commit is contained in:
commit
e9151b6ee9
3 changed files with 23 additions and 16 deletions
|
@ -34,6 +34,7 @@
|
||||||
- [Ryan Hartzell](https://github.com/ryan-hartzell)
|
- [Ryan Hartzell](https://github.com/ryan-hartzell)
|
||||||
- [Thibault Nocchi](https://github.com/ThibaultNocchi)
|
- [Thibault Nocchi](https://github.com/ThibaultNocchi)
|
||||||
- [MrTimscampi](https://github.com/MrTimscampi)
|
- [MrTimscampi](https://github.com/MrTimscampi)
|
||||||
|
- [Sarab Singh](https://github.com/sarab97)
|
||||||
|
|
||||||
# Emby Contributors
|
# Emby Contributors
|
||||||
|
|
||||||
|
|
|
@ -21,18 +21,24 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa
|
||||||
|
|
||||||
var index = options.startIndex || 0;
|
var index = options.startIndex || 0;
|
||||||
|
|
||||||
var newSlideShow = new slideshow({
|
var apiClient = connectionManager.currentApiClient();
|
||||||
showTitle: false,
|
|
||||||
cover: false,
|
apiClient.getCurrentUser().then(function(result) {
|
||||||
items: options.items,
|
|
||||||
startIndex: index,
|
var newSlideShow = new slideshow({
|
||||||
interval: 11000,
|
showTitle: false,
|
||||||
interactive: true
|
cover: false,
|
||||||
|
items: options.items,
|
||||||
|
startIndex: index,
|
||||||
|
interval: 11000,
|
||||||
|
interactive: true,
|
||||||
|
user: result
|
||||||
|
});
|
||||||
|
|
||||||
|
newSlideShow.show();
|
||||||
|
|
||||||
|
resolve();
|
||||||
});
|
});
|
||||||
|
|
||||||
newSlideShow.show();
|
|
||||||
|
|
||||||
resolve();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -66,14 +66,14 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
|
||||||
* @param {object} item - Item used to generate the image URL.
|
* @param {object} item - Item used to generate the image URL.
|
||||||
* @returns {string} URL of the item's image.
|
* @returns {string} URL of the item's image.
|
||||||
*/
|
*/
|
||||||
function getImgUrl(item) {
|
function getImgUrl(item, user) {
|
||||||
var apiClient = connectionManager.getApiClient(item.ServerId);
|
var apiClient = connectionManager.getApiClient(item.ServerId);
|
||||||
var imageOptions = {};
|
var imageOptions = {};
|
||||||
|
|
||||||
if (item.BackdropImageTags && item.BackdropImageTags.length) {
|
if (item.BackdropImageTags && item.BackdropImageTags.length) {
|
||||||
return getBackdropImageUrl(item, imageOptions, apiClient);
|
return getBackdropImageUrl(item, imageOptions, apiClient);
|
||||||
} else {
|
} else {
|
||||||
if (item.MediaType === 'Photo') {
|
if (item.MediaType === 'Photo' && user && user.Policy.EnableContentDownloading) {
|
||||||
return apiClient.getItemDownloadUrl(item.Id);
|
return apiClient.getItemDownloadUrl(item.Id);
|
||||||
}
|
}
|
||||||
imageOptions.type = "Primary";
|
imageOptions.type = "Primary";
|
||||||
|
@ -155,7 +155,7 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
|
||||||
|
|
||||||
html += '<div class="topActionButtons">';
|
html += '<div class="topActionButtons">';
|
||||||
if (actionButtonsOnTop) {
|
if (actionButtonsOnTop) {
|
||||||
if (appHost.supports('filedownload')) {
|
if (appHost.supports('filedownload') && options.user && options.user.Policy.EnableContentDownloading) {
|
||||||
html += getIcon('file_download', 'btnDownload slideshowButton', true);
|
html += getIcon('file_download', 'btnDownload slideshowButton', true);
|
||||||
}
|
}
|
||||||
if (appHost.supports('sharing')) {
|
if (appHost.supports('sharing')) {
|
||||||
|
@ -169,7 +169,7 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
|
||||||
html += '<div class="slideshowBottomBar hide">';
|
html += '<div class="slideshowBottomBar hide">';
|
||||||
|
|
||||||
html += getIcon('play_arrow', 'btnSlideshowPause slideshowButton', true, true);
|
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);
|
html += getIcon('file_download', 'btnDownload slideshowButton', true);
|
||||||
}
|
}
|
||||||
if (appHost.supports('sharing')) {
|
if (appHost.supports('sharing')) {
|
||||||
|
@ -312,7 +312,7 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
|
||||||
*/
|
*/
|
||||||
function getSwiperSlideHtmlFromItem(item) {
|
function getSwiperSlideHtmlFromItem(item) {
|
||||||
return getSwiperSlideHtmlFromSlide({
|
return getSwiperSlideHtmlFromSlide({
|
||||||
originalImage: getImgUrl(item),
|
originalImage: getImgUrl(item, currentOptions.user),
|
||||||
//title: item.Name,
|
//title: item.Name,
|
||||||
//description: item.Overview
|
//description: item.Overview
|
||||||
Id: item.Id,
|
Id: item.Id,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue