1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

display trailers within suggestions

This commit is contained in:
Luke Pulverenti 2014-09-30 00:47:30 -04:00
parent 5f61a3bbee
commit b5820d6e0b
18 changed files with 68 additions and 63 deletions

View file

@ -6,7 +6,10 @@
$('#chkEpisodes', page).checked(config.EnableIntrosForEpisodes).checkboxradio('refresh');
$('#chkMyMovieTrailers', page).checked(config.EnableIntrosFromMoviesInLibrary).checkboxradio('refresh');
$('#chkUpcomingTheaterTrailers', page).checked(config.EnableIntrosFromUpcomingTrailers).checkboxradio('refresh');
$('#chkUpcomingDvdTrailers', page).checked(config.EnableIntrosFromUpcomingDvdMovies).checkboxradio('refresh');
$('#chkUpcomingStreamingTrailers', page).checked(config.EnableIntrosFromUpcomingStreamingMovies).checkboxradio('refresh');
$('#chkUnwatchedOnly', page).checked(!config.EnableIntrosForWatchedContent).checkboxradio('refresh');
$('#chkEnableParentalControl', page).checked(config.EnableIntrosParentalControl).checkboxradio('refresh');
@ -70,10 +73,12 @@
config.EnableIntrosForMovies = $('#chkMovies', page).checked();
config.EnableIntrosForEpisodes = $('#chkEpisodes', page).checked();
config.EnableIntrosFromMoviesInLibrary = $('#chkMyMovieTrailers', page).checked();
config.EnableIntrosFromUpcomingTrailers = $('#chkUpcomingTheaterTrailers', page).checked();
config.EnableIntrosForWatchedContent = !$('#chkUnwatchedOnly', page).checked();
config.EnableIntrosParentalControl = $('#chkEnableParentalControl', page).checked();
config.EnableIntrosFromUpcomingTrailers = $('#chkUpcomingTheaterTrailers', page).checked();
config.EnableIntrosFromUpcomingDvdMovies = $('#chkUpcomingDvdTrailers', page).checked();
config.EnableIntrosFromUpcomingStreamingMovies = $('#chkUpcomingStreamingTrailers', page).checked();
ApiClient.updateNamedConfiguration("cinemamode", config).done(Dashboard.processServerConfigurationUpdateResult);
});

View file

@ -17,7 +17,9 @@
elem.html(html);
}
Sections.loadRecentlyAdded($('.section0', page), userId);
var context = 'home-latest';
Sections.loadRecentlyAdded($('.section0', page), userId, context);
Sections.loadLatestLiveTvRecordings($(".section1", page), userId);
Sections.loadLatestChannelItems($(".section2", page), userId);
}

View file

@ -122,7 +122,7 @@
});
}
function loadRecentlyAdded(elem, userId) {
function loadRecentlyAdded(elem, userId, context) {
var screenWidth = $(window).width();
@ -144,10 +144,10 @@
items: items,
preferThumb: true,
shape: 'homePageBackdrop',
context: 'home',
context: context || 'home',
showUnplayedIndicator: false,
showChildCountIndicator: true,
lazy: true
lazy: true,
});
html += '</div>';
}
@ -354,7 +354,7 @@
var options = {
Limit: screenWidth >= 1600 ? 5 : (screenWidth >= 1440 ? 5 : (screenWidth >= 800 ? 6 : 6)),
Limit: screenWidth >= 1600 ? 6 : (screenWidth >= 1440 ? 5 : (screenWidth >= 800 ? 6 : 6)),
Fields: "PrimaryImageAspectRatio",
Filters: "IsUnplayed",
UserId: Dashboard.getCurrentUserId(),

View file

@ -39,7 +39,7 @@
renderHeader(page, item, context);
LibraryBrowser.renderName(item, $('.itemName', page), false, context);
LibraryBrowser.renderParentName(item, $('.parentName', page));
LibraryBrowser.renderParentName(item, $('.parentName', page), context);
Dashboard.getCurrentUser().done(function (user) {
@ -243,6 +243,11 @@
$('a', elem).removeClass('ui-btn-active');
$('.lnkHomeUpcoming', page).addClass('ui-btn-active');
}
else if (context == 'home-latest') {
elem = $('.homeTabs', page).show();
$('a', elem).removeClass('ui-btn-active');
$('.lnkHomeLatest', page).addClass('ui-btn-active');
}
else if (context == 'movies' || item.Type == 'Movie') {
elem = $('#movieTabs', page).show();
$('a', elem).removeClass('ui-btn-active');

View file

@ -590,6 +590,7 @@
},
getUserDataCssClass: function (key) {
return 'libraryItemUserData' + key.replace(new RegExp(' ', 'g'), '');
},
@ -1569,34 +1570,36 @@
}
},
renderParentName: function (item, parentNameElem) {
renderParentName: function (item, parentNameElem, context) {
var html = [];
var contextParam = context ? ('&context=' + context) : '';
if (item.AlbumArtist && item.Type == "Audio") {
html.push('<a class="detailPageParentLink" href="itembynamedetails.html?context=music&musicartist=' + ApiClient.encodeName(item.AlbumArtist) + '">' + item.AlbumArtist + '</a>');
html.push('<a class="detailPageParentLink" href="itembynamedetails.html?context=music&musicartist=' + ApiClient.encodeName(item.AlbumArtist) + contextParam + '">' + item.AlbumArtist + '</a>');
} else if (item.AlbumArtist && item.Type == "MusicAlbum") {
html.push('<a class="detailPageParentLink" href="itembynamedetails.html?context=music&musicartist=' + ApiClient.encodeName(item.AlbumArtist) + '">' + item.AlbumArtist + '</a>');
html.push('<a class="detailPageParentLink" href="itembynamedetails.html?context=music&musicartist=' + ApiClient.encodeName(item.AlbumArtist) + contextParam + '">' + item.AlbumArtist + '</a>');
} else if (item.Artists && item.Artists.length && item.Type == "MusicVideo") {
html.push('<a class="detailPageParentLink" href="itembynamedetails.html?context=music&musicartist=' + ApiClient.encodeName(item.Artists[0]) + '">' + item.Artists[0] + '</a>');
html.push('<a class="detailPageParentLink" href="itembynamedetails.html?context=music&musicartist=' + ApiClient.encodeName(item.Artists[0]) + contextParam + '">' + item.Artists[0] + '</a>');
} else if (item.SeriesName && item.Type == "Episode") {
html.push('<a class="detailPageParentLink" href="itemdetails.html?id=' + item.SeriesId + '">' + item.SeriesName + '</a>');
html.push('<a class="detailPageParentLink" href="itemdetails.html?id=' + item.SeriesId + contextParam + '">' + item.SeriesName + '</a>');
}
if (item.SeriesName && item.Type == "Season") {
html.push('<a class="detailPageParentLink" href="itemdetails.html?id=' + item.SeriesId + '">' + item.SeriesName + '</a>');
html.push('<a class="detailPageParentLink" href="itemdetails.html?id=' + item.SeriesId + contextParam + '">' + item.SeriesName + '</a>');
} else if (item.ParentIndexNumber != null && item.Type == "Episode") {
html.push('<a class="detailPageParentLink" href="itemdetails.html?id=' + item.SeasonId + '">' + item.SeasonName + '</a>');
html.push('<a class="detailPageParentLink" href="itemdetails.html?id=' + item.SeasonId + contextParam + '">' + item.SeasonName + '</a>');
} else if (item.Album && item.Type == "Audio" && (item.AlbumId || item.ParentId)) {
html.push('<a class="detailPageParentLink" href="itemdetails.html?id=' + (item.AlbumId || item.ParentId) + '">' + item.Album + '</a>');
html.push('<a class="detailPageParentLink" href="itemdetails.html?id=' + (item.AlbumId || item.ParentId) + contextParam + '">' + item.Album + '</a>');
} else if (item.Album && item.Type == "MusicVideo" && item.AlbumId) {
html.push('<a class="detailPageParentLink" href="itemdetails.html?id=' + item.AlbumId + '">' + item.Album + '</a>');
html.push('<a class="detailPageParentLink" href="itemdetails.html?id=' + item.AlbumId + contextParam + '">' + item.Album + '</a>');
} else if (item.AlbumArtist && item.Type == "MusicAlbum") {

View file

@ -232,7 +232,7 @@
$('.movieTabs', page).hide();
}
query.ParentId = LibraryMenu.getTopParentId();
//query.ParentId = LibraryMenu.getTopParentId();
var limit = LibraryBrowser.getDefaultPageSize();

View file

@ -83,7 +83,7 @@
userId: Dashboard.getCurrentUserId(),
categoryLimit: screenWidth >= 1200 ? 4 : 3,
ItemLimit: screenWidth >= 1920 ? 9 : (screenWidth >= 1600 ? 7 : (screenWidth >= 1200 ? 6 : 5)),
ItemLimit: screenWidth >= 1920 ? 10 : (screenWidth >= 1600 ? 7 : (screenWidth >= 1200 ? 6 : 5)),
Fields: "PrimaryImageAspectRatio"
});

View file

@ -100,6 +100,8 @@
$('#chkDisplayMissingEpisodes', page).checked(user.Configuration.DisplayMissingEpisodes || false).checkboxradio("refresh");
$('#chkDisplayUnairedEpisodes', page).checked(user.Configuration.DisplayUnairedEpisodes || false).checkboxradio("refresh");
$('#chkDisplayTrailersWithinMovieSuggestions', page).checked(user.Configuration.IncludeTrailersInSuggestions || false).checkboxradio("refresh");
$('#chkGroupMoviesIntoCollections', page).checked(user.Configuration.GroupMoviesIntoBoxSets || false).checkboxradio("refresh");
$('#chkDisplayCollectionView', page).checked(user.Configuration.DisplayCollectionsView || false).checkboxradio("refresh");
$('#chkDisplayFolderView', page).checked(user.Configuration.DisplayFoldersView || false).checkboxradio("refresh");
@ -133,6 +135,8 @@
user.Configuration.DisplayCollectionsView = $('#chkDisplayCollectionView', page).checked();
user.Configuration.DisplayFoldersView = $('#chkDisplayFolderView', page).checked();
user.Configuration.IncludeTrailersInSuggestions = $('#chkDisplayTrailersWithinMovieSuggestions', page).checked();
user.Configuration.ExcludeFoldersFromGrouping = $(".chkGroupFolder:not(:checked)", page).get().map(function (i) {
return i.getAttribute('data-folderid');

View file

@ -45,7 +45,7 @@
var lifeTimeAmount = 30;
var dailyAmount = 1;
var monthlyAmount = 3;
var monthlyAmount = 4;
var yearlyAmount = 20;
function getDonationAmount(page) {

View file

@ -67,7 +67,7 @@
$('.noNextUpItems', page).show();
}
$('#nextUpItems', page).html(LibraryBrowser.getPosterViewHtml({
var html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "homePageBackdrop",
showTitle: true,
@ -76,7 +76,9 @@
context: context,
lazy: true
})).trigger('create').createCardMenus();
});
$('#nextUpItems', page).html(html).trigger('create').createCardMenus();
});
}