mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
separate latest
This commit is contained in:
parent
e093d85352
commit
bf511950ae
@ -85,13 +85,9 @@
|
||||
}
|
||||
|
||||
.homePageSection {
|
||||
margin-top: 20px;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.homePageSection + .homePageSection {
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.sectionHeaderButton {
|
||||
vertical-align: middle;
|
||||
margin: 0 0 .25em 1.5em;
|
||||
|
@ -17,7 +17,7 @@
|
||||
<option value="latesttvrecordings">${OptionLatestTvRecordings}</option>
|
||||
<option value="nextup">${HeaderNextUp}</option>
|
||||
<option value="smalllibrarytiles">${OptionMyMedia}</option>
|
||||
<option value="librarybuttons">${OptionMyMediaButtons}</option>
|
||||
<option value="librarybuttons">${OptionMyMediaSmall}</option>
|
||||
<option value="resume">${OptionResumablemedia}</option>
|
||||
</select>
|
||||
</div>
|
||||
@ -29,7 +29,7 @@
|
||||
<option value="latesttvrecordings">${OptionLatestTvRecordings}</option>
|
||||
<option value="nextup">${HeaderNextUp}</option>
|
||||
<option value="smalllibrarytiles">${OptionMyMedia}</option>
|
||||
<option value="librarybuttons">${OptionMyMediaButtons}</option>
|
||||
<option value="librarybuttons">${OptionMyMediaSmall}</option>
|
||||
<option value="resume">${OptionResumablemedia}</option>
|
||||
<option value="none">${OptionNone}</option>
|
||||
</select>
|
||||
@ -42,7 +42,7 @@
|
||||
<option value="latesttvrecordings">${OptionLatestTvRecordings}</option>
|
||||
<option value="nextup">${HeaderNextUp}</option>
|
||||
<option value="smalllibrarytiles">${OptionMyMedia}</option>
|
||||
<option value="librarybuttons">${OptionMyMediaButtons}</option>
|
||||
<option value="librarybuttons">${OptionMyMediaSmall}</option>
|
||||
<option value="resume">${OptionResumablemedia}</option>
|
||||
<option value="none">${OptionNone}</option>
|
||||
</select>
|
||||
@ -55,7 +55,7 @@
|
||||
<option value="latesttvrecordings">${OptionLatestTvRecordings}</option>
|
||||
<option value="nextup">${HeaderNextUp}</option>
|
||||
<option value="smalllibrarytiles">${OptionMyMedia}</option>
|
||||
<option value="librarybuttons">${OptionMyMediaButtons}</option>
|
||||
<option value="librarybuttons">${OptionMyMediaSmall}</option>
|
||||
<option value="resume">${OptionResumablemedia}</option>
|
||||
<option value="none">${OptionNone}</option>
|
||||
</select>
|
||||
|
@ -5,26 +5,6 @@
|
||||
|
||||
function getDefaultSection(index) {
|
||||
|
||||
if (AppInfo.isNativeApp) {
|
||||
|
||||
switch (index) {
|
||||
|
||||
case 0:
|
||||
return defaultFirstSection;
|
||||
case 1:
|
||||
return 'resume';
|
||||
case 2:
|
||||
return 'nextup';
|
||||
case 3:
|
||||
return 'latestmovies';
|
||||
case 4:
|
||||
return 'latestepisodes';
|
||||
case 5:
|
||||
return 'latesttvrecordings';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
switch (index) {
|
||||
|
||||
case 0:
|
||||
@ -32,13 +12,14 @@
|
||||
case 1:
|
||||
return 'resume';
|
||||
case 2:
|
||||
return 'latestmedia';
|
||||
return 'nextup';
|
||||
case 3:
|
||||
return 'latestmedia';
|
||||
case 4:
|
||||
return 'latesttvrecordings';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function loadSection(page, user, displayPreferences, index) {
|
||||
@ -58,12 +39,6 @@
|
||||
if (section == 'latestmedia') {
|
||||
return Sections.loadRecentlyAdded(elem, user);
|
||||
}
|
||||
else if (section == 'latestmovies') {
|
||||
return Sections.loadLatestMovies(elem, user);
|
||||
}
|
||||
else if (section == 'latestepisodes') {
|
||||
return Sections.loadLatestEpisodes(elem, user);
|
||||
}
|
||||
else if (section == 'librarytiles') {
|
||||
return Sections.loadLibraryTiles(elem, user, 'backdrop', index, false, showLibraryTileNames);
|
||||
}
|
||||
@ -105,7 +80,7 @@
|
||||
function loadSections(page, user, displayPreferences) {
|
||||
|
||||
var i, length;
|
||||
var sectionCount = 6;
|
||||
var sectionCount = 5;
|
||||
|
||||
var elem = page.querySelector('.sections');
|
||||
|
||||
|
@ -254,48 +254,18 @@
|
||||
|
||||
function loadRecentlyAdded(elem, user) {
|
||||
|
||||
var options = {
|
||||
var moviesFrag = document.createElement('div');
|
||||
var episodesFrag = document.createElement('div');
|
||||
|
||||
Limit: 20,
|
||||
Fields: "PrimaryImageAspectRatio,BasicSyncInfo",
|
||||
ImageTypeLimit: 1,
|
||||
EnableImageTypes: "Primary,Backdrop,Thumb"
|
||||
};
|
||||
elem.classList.remove('homePageSection');
|
||||
moviesFrag.classList.add('homePageSection');
|
||||
episodesFrag.classList.add('homePageSection');
|
||||
|
||||
return ApiClient.getJSON(ApiClient.getUrl('Users/' + user.Id + '/Items/Latest', options)).then(function (items) {
|
||||
elem.appendChild(moviesFrag);
|
||||
elem.appendChild(episodesFrag);
|
||||
|
||||
var html = '';
|
||||
|
||||
var cardLayout = false;
|
||||
|
||||
if (items.length) {
|
||||
html += '<div>';
|
||||
html += '<h1 class="listHeader">' + Globalize.translate('HeaderLatestMedia') + '</h1>';
|
||||
|
||||
html += '</div>';
|
||||
|
||||
html += '<div is="emby-itemscontainer" class="itemsContainer vertical-wrap">';
|
||||
|
||||
html += cardBuilder.getCardsHtml({
|
||||
items: items,
|
||||
preferThumb: true,
|
||||
shape: 'backdrop',
|
||||
showUnplayedIndicator: false,
|
||||
showChildCountIndicator: true,
|
||||
lazy: true,
|
||||
cardLayout: cardLayout,
|
||||
showTitle: cardLayout,
|
||||
showYear: cardLayout,
|
||||
showDetailsMenu: true,
|
||||
context: 'home'
|
||||
});
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
elem.innerHTML = html;
|
||||
elem.addEventListener('click', groupedcards.onItemsContainerClick);
|
||||
ImageLoader.lazyChildren(elem);
|
||||
});
|
||||
loadLatestMovies(moviesFrag, user);
|
||||
loadLatestEpisodes(episodesFrag, user);
|
||||
}
|
||||
|
||||
function loadLatestMovies(elem, user) {
|
||||
@ -536,7 +506,7 @@
|
||||
|
||||
var query = {
|
||||
|
||||
Limit: 20,
|
||||
Limit: enableScrollX() ? 20 : 10,
|
||||
Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated,BasicSyncInfo",
|
||||
UserId: userId,
|
||||
ImageTypeLimit: 1,
|
||||
@ -721,9 +691,7 @@
|
||||
loadNextUp: loadNextUp,
|
||||
loadLatestChannelItems: loadLatestChannelItems,
|
||||
loadLatestLiveTvRecordings: loadLatestLiveTvRecordings,
|
||||
loadlibraryButtons: loadlibraryButtons,
|
||||
loadLatestMovies: loadLatestMovies,
|
||||
loadLatestEpisodes: loadLatestEpisodes
|
||||
loadlibraryButtons: loadlibraryButtons
|
||||
};
|
||||
|
||||
return window.Sections;
|
||||
|
Loading…
Reference in New Issue
Block a user