mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
#712 - Support grouping multiple versions of a movie
This commit is contained in:
parent
e3e1ab2db3
commit
7e2ffe8202
3 changed files with 57 additions and 13 deletions
|
@ -175,6 +175,12 @@
|
|||
</div>
|
||||
<div id="trailersContent" class="detailSectionContent"></div>
|
||||
</div>
|
||||
<div id="alternateVersionsCollapsible" class="detailSection hide">
|
||||
<div class="detailSectionHeader">
|
||||
Alternate Versions
|
||||
</div>
|
||||
<div id="alternateVersionsContent" class="detailSectionContent"></div>
|
||||
</div>
|
||||
<div id="additionalPartsCollapsible" class="detailSection hide">
|
||||
<div class="detailSectionHeader">
|
||||
Additional Parts
|
||||
|
|
|
@ -227,6 +227,13 @@
|
|||
renderAdditionalParts(page, item, user);
|
||||
}
|
||||
|
||||
if (!item.HasAlternateVersions) {
|
||||
$('#alternateVersionsCollapsible', page).addClass('hide');
|
||||
} else {
|
||||
$('#alternateVersionsCollapsible', page).removeClass('hide');
|
||||
renderAlternateVersions(page, item, user);
|
||||
}
|
||||
|
||||
$('#themeSongsCollapsible', page).hide();
|
||||
$('#themeVideosCollapsible', page).hide();
|
||||
|
||||
|
@ -665,7 +672,7 @@
|
|||
|
||||
var otherTypeItems = items.filter(function (curr) {
|
||||
|
||||
return !types.filter(function(t) {
|
||||
return !types.filter(function (t) {
|
||||
|
||||
return t.type == curr.Type;
|
||||
|
||||
|
@ -678,7 +685,7 @@
|
|||
}
|
||||
|
||||
if (!items.length) {
|
||||
renderCollectionItemType(page, {name: 'Titles'}, items, user);
|
||||
renderCollectionItemType(page, { name: 'Titles' }, items, user);
|
||||
}
|
||||
|
||||
$('.collectionItems', page).trigger('create').createPosterItemHoverMenu();
|
||||
|
@ -886,6 +893,37 @@
|
|||
});
|
||||
}
|
||||
|
||||
function renderAlternateVersions(page, item, user) {
|
||||
|
||||
var url = ApiClient.getUrl("Videos/" + item.Id + "/AlternateVersions", {
|
||||
userId: user.Id
|
||||
});
|
||||
|
||||
$.getJSON(url).done(function (result) {
|
||||
|
||||
if (result.Items.length) {
|
||||
|
||||
$('#alternateVersionsCollapsible', page).show();
|
||||
|
||||
$('#additionalPartsCollapsible', page).show();
|
||||
|
||||
var html = LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
shape: "portrait",
|
||||
context: 'movies',
|
||||
useAverageAspectRatio: true,
|
||||
showTitle: true,
|
||||
centerText: true,
|
||||
formatIndicators: true
|
||||
});
|
||||
|
||||
$('#alternateVersionsContent', page).html(html).trigger('create').createPosterItemHoverMenu();
|
||||
} else {
|
||||
$('#alternateVersionsCollapsible', page).hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function renderScenes(page, item, user, limit) {
|
||||
var html = '';
|
||||
|
||||
|
|
|
@ -665,7 +665,7 @@
|
|||
html += '<a data-itemid="' + item.Id + '" class="' + cssClass + '" data-locationtype="' + item.LocationType + '" data-mediatype="' + (item.MediaType || '') + '" href="' + LibraryBrowser.getHref(item, options.context) + '">';
|
||||
|
||||
// Ribbon
|
||||
if (item.MediaType == "Video" && item.Video3DFormat) {
|
||||
if (item.MediaType == "Video" && options.formatIndicators) {
|
||||
// This would be much better if specified in the json payload
|
||||
// Another nice thing to have in the payload would be 720 vs 1080
|
||||
// Then, rather than "HD" it could display the specific HD format
|
||||
|
@ -2186,18 +2186,18 @@
|
|||
|
||||
var sequence = this;
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
//Dashboard.getCurrentUser().done(function (user) {
|
||||
|
||||
if (user.Configuration.IsAdministrator) {
|
||||
// if (user.Configuration.IsAdministrator) {
|
||||
|
||||
sequence.createContextMenu({
|
||||
getOptions: getMenuOptions,
|
||||
command: onMenuCommand,
|
||||
selector: '.posterItem'
|
||||
});
|
||||
}
|
||||
// sequence.createContextMenu({
|
||||
// getOptions: getMenuOptions,
|
||||
// command: onMenuCommand,
|
||||
// selector: '.posterItem'
|
||||
// });
|
||||
// }
|
||||
|
||||
});
|
||||
//});
|
||||
|
||||
return this.on('mouseenter', '.backdropPosterItem,.smallBackdropPosterItem,.portraitPosterItem,.squarePosterItem', onHoverIn)
|
||||
.on('mouseleave', '.backdropPosterItem,.smallBackdropPosterItem,.portraitPosterItem,.squarePosterItem', onHoverOut);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue