separate latest

This commit is contained in:
Luke Pulverenti 2016-10-28 15:20:22 -04:00
parent e093d85352
commit bf511950ae
4 changed files with 20 additions and 81 deletions

View File

@ -85,13 +85,9 @@
} }
.homePageSection { .homePageSection {
margin-top: 20px; margin-top: 30px;
} }
.homePageSection + .homePageSection {
margin-top: 30px;
}
.sectionHeaderButton { .sectionHeaderButton {
vertical-align: middle; vertical-align: middle;
margin: 0 0 .25em 1.5em; margin: 0 0 .25em 1.5em;

View File

@ -17,7 +17,7 @@
<option value="latesttvrecordings">${OptionLatestTvRecordings}</option> <option value="latesttvrecordings">${OptionLatestTvRecordings}</option>
<option value="nextup">${HeaderNextUp}</option> <option value="nextup">${HeaderNextUp}</option>
<option value="smalllibrarytiles">${OptionMyMedia}</option> <option value="smalllibrarytiles">${OptionMyMedia}</option>
<option value="librarybuttons">${OptionMyMediaButtons}</option> <option value="librarybuttons">${OptionMyMediaSmall}</option>
<option value="resume">${OptionResumablemedia}</option> <option value="resume">${OptionResumablemedia}</option>
</select> </select>
</div> </div>
@ -29,7 +29,7 @@
<option value="latesttvrecordings">${OptionLatestTvRecordings}</option> <option value="latesttvrecordings">${OptionLatestTvRecordings}</option>
<option value="nextup">${HeaderNextUp}</option> <option value="nextup">${HeaderNextUp}</option>
<option value="smalllibrarytiles">${OptionMyMedia}</option> <option value="smalllibrarytiles">${OptionMyMedia}</option>
<option value="librarybuttons">${OptionMyMediaButtons}</option> <option value="librarybuttons">${OptionMyMediaSmall}</option>
<option value="resume">${OptionResumablemedia}</option> <option value="resume">${OptionResumablemedia}</option>
<option value="none">${OptionNone}</option> <option value="none">${OptionNone}</option>
</select> </select>
@ -42,7 +42,7 @@
<option value="latesttvrecordings">${OptionLatestTvRecordings}</option> <option value="latesttvrecordings">${OptionLatestTvRecordings}</option>
<option value="nextup">${HeaderNextUp}</option> <option value="nextup">${HeaderNextUp}</option>
<option value="smalllibrarytiles">${OptionMyMedia}</option> <option value="smalllibrarytiles">${OptionMyMedia}</option>
<option value="librarybuttons">${OptionMyMediaButtons}</option> <option value="librarybuttons">${OptionMyMediaSmall}</option>
<option value="resume">${OptionResumablemedia}</option> <option value="resume">${OptionResumablemedia}</option>
<option value="none">${OptionNone}</option> <option value="none">${OptionNone}</option>
</select> </select>
@ -55,7 +55,7 @@
<option value="latesttvrecordings">${OptionLatestTvRecordings}</option> <option value="latesttvrecordings">${OptionLatestTvRecordings}</option>
<option value="nextup">${HeaderNextUp}</option> <option value="nextup">${HeaderNextUp}</option>
<option value="smalllibrarytiles">${OptionMyMedia}</option> <option value="smalllibrarytiles">${OptionMyMedia}</option>
<option value="librarybuttons">${OptionMyMediaButtons}</option> <option value="librarybuttons">${OptionMyMediaSmall}</option>
<option value="resume">${OptionResumablemedia}</option> <option value="resume">${OptionResumablemedia}</option>
<option value="none">${OptionNone}</option> <option value="none">${OptionNone}</option>
</select> </select>

View File

@ -5,26 +5,6 @@
function getDefaultSection(index) { 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) { switch (index) {
case 0: case 0:
@ -32,13 +12,14 @@
case 1: case 1:
return 'resume'; return 'resume';
case 2: case 2:
return 'latestmedia'; return 'nextup';
case 3: case 3:
return 'latestmedia';
case 4:
return 'latesttvrecordings'; return 'latesttvrecordings';
default: default:
return ''; return '';
} }
} }
function loadSection(page, user, displayPreferences, index) { function loadSection(page, user, displayPreferences, index) {
@ -58,12 +39,6 @@
if (section == 'latestmedia') { if (section == 'latestmedia') {
return Sections.loadRecentlyAdded(elem, user); 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') { else if (section == 'librarytiles') {
return Sections.loadLibraryTiles(elem, user, 'backdrop', index, false, showLibraryTileNames); return Sections.loadLibraryTiles(elem, user, 'backdrop', index, false, showLibraryTileNames);
} }
@ -105,7 +80,7 @@
function loadSections(page, user, displayPreferences) { function loadSections(page, user, displayPreferences) {
var i, length; var i, length;
var sectionCount = 6; var sectionCount = 5;
var elem = page.querySelector('.sections'); var elem = page.querySelector('.sections');

View File

@ -254,48 +254,18 @@
function loadRecentlyAdded(elem, user) { function loadRecentlyAdded(elem, user) {
var options = { var moviesFrag = document.createElement('div');
var episodesFrag = document.createElement('div');
Limit: 20, elem.classList.remove('homePageSection');
Fields: "PrimaryImageAspectRatio,BasicSyncInfo", moviesFrag.classList.add('homePageSection');
ImageTypeLimit: 1, episodesFrag.classList.add('homePageSection');
EnableImageTypes: "Primary,Backdrop,Thumb"
};
return ApiClient.getJSON(ApiClient.getUrl('Users/' + user.Id + '/Items/Latest', options)).then(function (items) { elem.appendChild(moviesFrag);
elem.appendChild(episodesFrag);
var html = ''; loadLatestMovies(moviesFrag, user);
loadLatestEpisodes(episodesFrag, user);
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);
});
} }
function loadLatestMovies(elem, user) { function loadLatestMovies(elem, user) {
@ -536,7 +506,7 @@
var query = { var query = {
Limit: 20, Limit: enableScrollX() ? 20 : 10,
Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated,BasicSyncInfo", Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated,BasicSyncInfo",
UserId: userId, UserId: userId,
ImageTypeLimit: 1, ImageTypeLimit: 1,
@ -721,9 +691,7 @@
loadNextUp: loadNextUp, loadNextUp: loadNextUp,
loadLatestChannelItems: loadLatestChannelItems, loadLatestChannelItems: loadLatestChannelItems,
loadLatestLiveTvRecordings: loadLatestLiveTvRecordings, loadLatestLiveTvRecordings: loadLatestLiveTvRecordings,
loadlibraryButtons: loadlibraryButtons, loadlibraryButtons: loadlibraryButtons
loadLatestMovies: loadLatestMovies,
loadLatestEpisodes: loadLatestEpisodes
}; };
return window.Sections; return window.Sections;