diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index 30107fa680..174fe490e2 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -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; diff --git a/dashboard-ui/mypreferenceshome.html b/dashboard-ui/mypreferenceshome.html index c08aba1cf5..1546fbd673 100644 --- a/dashboard-ui/mypreferenceshome.html +++ b/dashboard-ui/mypreferenceshome.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -55,7 +55,7 @@ - + diff --git a/dashboard-ui/scripts/indexpage.js b/dashboard-ui/scripts/indexpage.js index 47d863b986..5418e13cfc 100644 --- a/dashboard-ui/scripts/indexpage.js +++ b/dashboard-ui/scripts/indexpage.js @@ -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'); diff --git a/dashboard-ui/scripts/sections.js b/dashboard-ui/scripts/sections.js index 70a0adb64b..c1733413f7 100644 --- a/dashboard-ui/scripts/sections.js +++ b/dashboard-ui/scripts/sections.js @@ -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 += '
'; - html += '

' + Globalize.translate('HeaderLatestMedia') + '

'; - - html += '
'; - - html += '
'; - - 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 += '
'; - } - - 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;