#712 - Group multiple versions
This commit is contained in:
@@ -28,9 +28,6 @@
|
||||
|
||||
updateFilterControls();
|
||||
|
||||
var checkSortOption = $('.radioSortBy:checked', page);
|
||||
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
|
||||
|
||||
html += LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
useAverageAspectRatio: true,
|
||||
|
||||
@@ -27,9 +27,6 @@
|
||||
|
||||
updateFilterControls(page);
|
||||
|
||||
var checkSortOption = $('.radioSortBy:checked', page);
|
||||
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
|
||||
|
||||
html = LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
shape: "auto",
|
||||
|
||||
@@ -901,23 +901,29 @@
|
||||
userId: user.Id
|
||||
});
|
||||
|
||||
$.getJSON(url).done(function (result) {
|
||||
$.getJSON(url).done(function (items) {
|
||||
|
||||
if (result.Items.length) {
|
||||
if (items.length) {
|
||||
|
||||
$('#alternateVersionsCollapsible', page).show();
|
||||
|
||||
var html = LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
items: items.map(function (i) {
|
||||
var extended = $.extend({}, item, i);
|
||||
extended.Id = item.Id;
|
||||
return extended;
|
||||
}),
|
||||
shape: "portrait",
|
||||
context: 'movies',
|
||||
useAverageAspectRatio: true,
|
||||
showTitle: true,
|
||||
centerText: true,
|
||||
formatIndicators: true
|
||||
formatIndicators: true,
|
||||
linkItem: false,
|
||||
showProgress: false
|
||||
});
|
||||
|
||||
$('#alternateVersionsContent', page).html(html).trigger('create').createPosterItemMenus();
|
||||
$('#alternateVersionsContent', page).html(html).trigger('create');
|
||||
} else {
|
||||
$('#alternateVersionsCollapsible', page).hide();
|
||||
}
|
||||
|
||||
@@ -30,9 +30,6 @@
|
||||
|
||||
updateFilterControls(page);
|
||||
|
||||
var checkSortOption = $('.radioSortBy:checked', page);
|
||||
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
|
||||
|
||||
if (view == "Backdrop") {
|
||||
|
||||
html = LibraryBrowser.getPosterViewHtml({
|
||||
|
||||
@@ -665,7 +665,9 @@
|
||||
|
||||
cssClass += ' ' + options.shape + 'PosterItem';
|
||||
|
||||
html += '<a data-itemid="' + item.Id + '" class="' + cssClass + '" data-alternateversioncount="' + (item.AlternateVersionCount || '0') + '" href="' + LibraryBrowser.getHref(item, options.context) + '">';
|
||||
var href = options.linkItem === false ? '#' : LibraryBrowser.getHref(item, options.context);
|
||||
|
||||
html += '<a data-itemid="' + item.Id + '" class="' + cssClass + '" data-alternateversioncount="' + (item.AlternateVersionCount || '0') + '" href="' + href + '">';
|
||||
|
||||
// Ribbon
|
||||
if (item.MediaType == "Video" && options.formatIndicators) {
|
||||
@@ -706,7 +708,7 @@
|
||||
imageCssClass += " coveredPosterItemImage";
|
||||
}
|
||||
|
||||
var progressHtml = LibraryBrowser.getItemProgressBarHtml(item);
|
||||
var progressHtml = options.showProgress === false ? '' : LibraryBrowser.getItemProgressBarHtml(item);
|
||||
|
||||
html += '<div class="' + imageCssClass + '" style="' + style + '">';
|
||||
|
||||
@@ -731,7 +733,7 @@
|
||||
var chkItemSelectId = 'chkItemSelect' + i;
|
||||
|
||||
// Render this pre-enhanced to save on jquery mobile dom manipulation
|
||||
html += '<div class="itemSelectionPanel" onclick="return false;"><div class="ui-checkbox"><label class="ui-btn ui-corner-all ui-btn-inherit ui-btn-icon-left ui-checkbox-off" for="' + chkItemSelectId + '">Select</label><input id="' + chkItemSelectId + '" type="checkbox" class="chkItemSelect" data-enhanced="true" /></div></div>';
|
||||
html += '<div class="itemSelectionPanel" onclick="return false;"><div class="ui-checkbox ui-mini"><label class="ui-btn ui-corner-all ui-btn-inherit ui-btn-icon-left ui-checkbox-off" for="' + chkItemSelectId + '">Select</label><input id="' + chkItemSelectId + '" type="checkbox" class="chkItemSelect" data-enhanced="true" /></div></div>';
|
||||
|
||||
}
|
||||
|
||||
@@ -1158,21 +1160,6 @@
|
||||
}
|
||||
},
|
||||
|
||||
getViewSummaryHtml: function (query, checkedSortOption) {
|
||||
|
||||
var html = '';
|
||||
|
||||
if (query.SortBy) {
|
||||
|
||||
var id = checkedSortOption[0].id;
|
||||
var sortBy = checkedSortOption.siblings('label[for=' + id + ']').text();
|
||||
|
||||
html += 'Sorted by ' + sortBy.trim().toLowerCase() + ', ' + (query.SortOrder || 'ascending').toLowerCase();
|
||||
}
|
||||
|
||||
return html;
|
||||
},
|
||||
|
||||
getPagingHtml: function (query, totalRecordCount, updatePageSizeSetting, pageSizes, showLimit) {
|
||||
|
||||
if (query.Limit && updatePageSizeSetting !== false) {
|
||||
|
||||
@@ -175,18 +175,25 @@
|
||||
|
||||
function splitVersions(id, page) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
Dashboard.confirm("Are you sure you wish to split the versions apart into separate items?", "Split Versions Apart", function (confirmResult) {
|
||||
|
||||
$.ajax({
|
||||
type: "DELETE",
|
||||
url: ApiClient.getUrl("Videos/" + id + "/AlternateVersions")
|
||||
if (confirmResult) {
|
||||
|
||||
}).done(function () {
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
$.ajax({
|
||||
type: "DELETE",
|
||||
url: ApiClient.getUrl("Videos/" + id + "/AlternateVersions")
|
||||
|
||||
$('.itemsContainer', page).trigger('needsrefresh');
|
||||
}).done(function () {
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
||||
$('.itemsContainer', page).trigger('needsrefresh');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function getContextMenuOptions(elem) {
|
||||
@@ -205,7 +212,7 @@
|
||||
|
||||
items.push({ type: 'divider' });
|
||||
items.push({ type: 'header', text: 'Manage' });
|
||||
items.push({ type: 'command', text: 'Split Versions', name: 'SplitVersions' });
|
||||
items.push({ type: 'command', text: 'Split Versions Apart', name: 'SplitVersions' });
|
||||
}
|
||||
|
||||
return items;
|
||||
@@ -221,7 +228,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if ($('.itemSelectionPanel', elem).length) {
|
||||
if ($('.itemSelectionPanel:visible', elem).length) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,9 +28,6 @@
|
||||
|
||||
if (result.TotalRecordCount) {
|
||||
|
||||
var checkSortOption = $('.radioSortBy:checked', page);
|
||||
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
|
||||
|
||||
html = LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
shape: "portrait",
|
||||
|
||||
@@ -29,9 +29,6 @@
|
||||
|
||||
updateFilterControls(page);
|
||||
|
||||
var checkSortOption = $('.radioSortBy:checked', page);
|
||||
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
|
||||
|
||||
if (view == "Thumb") {
|
||||
html = LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
|
||||
@@ -26,9 +26,6 @@
|
||||
|
||||
updateFilterControls(page);
|
||||
|
||||
var checkSortOption = $('.radioSortBy:checked', page);
|
||||
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
|
||||
|
||||
html = LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
shape: "portrait",
|
||||
|
||||
@@ -28,9 +28,6 @@
|
||||
|
||||
updateFilterControls(page);
|
||||
|
||||
var checkSortOption = $('.radioSortBy:checked', page);
|
||||
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
|
||||
|
||||
if (view == "Poster") {
|
||||
html = LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
|
||||
@@ -26,9 +26,6 @@
|
||||
|
||||
updateFilterControls(page);
|
||||
|
||||
var checkSortOption = $('.radioSortBy:checked', page);
|
||||
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
|
||||
|
||||
html = LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
shape: "square",
|
||||
|
||||
@@ -47,9 +47,6 @@
|
||||
|
||||
updateFilterControls(page);
|
||||
|
||||
var checkSortOption = $('.radioSortBy:checked', page);
|
||||
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
|
||||
|
||||
html += LibraryBrowser.getSongTableHtml(result.Items, {
|
||||
showAlbum: true,
|
||||
showArtist: true,
|
||||
|
||||
@@ -28,9 +28,6 @@
|
||||
|
||||
updateFilterControls(page);
|
||||
|
||||
var checkSortOption = $('.radioSortBy:checked', page);
|
||||
$('.viewSummary', page).html(LibraryBrowser.getViewSummaryHtml(query, checkSortOption)).trigger('create');
|
||||
|
||||
if (view == "Thumb") {
|
||||
|
||||
html = LibraryBrowser.getPosterViewHtml({
|
||||
|
||||
Reference in New Issue
Block a user