define(['libraryBrowser', 'cardBuilder', 'scrollStyles', 'emby-itemscontainer'], function (libraryBrowser, cardBuilder) { function enableScrollX() { return browserInfo.mobile && AppInfo.enableAppLayouts; } function getThumbShape() { return enableScrollX() ? 'overflowBackdrop' : 'backdrop'; } function getPosterShape() { return enableScrollX() ? 'overflowPortrait' : 'portrait'; } function getSquareShape() { return enableScrollX() ? 'overflowSquare' : 'square'; } function getSections() { return [ { name: 'HeaderFavoriteMovies', types: "Movie", id: "favoriteMovies", shape: getPosterShape(), showTitle: false, overlayPlayButton: true }, { name: 'HeaderFavoriteShows', types: "Series", id: "favoriteShows", shape: getPosterShape(), showTitle: false, overlayPlayButton: true }, { name: 'HeaderFavoriteEpisodes', types: "Episode", id: "favoriteEpisode", shape: getThumbShape(), preferThumb: false, showTitle: true, showParentTitle: true, overlayPlayButton: true }, { name: 'HeaderFavoriteGames', types: "Game", id: "favoriteGames", shape: getSquareShape(), preferThumb: false, showTitle: true }, { name: 'HeaderFavoriteArtists', types: "MusicArtist", id: "favoriteArtists", shape: getSquareShape(), preferThumb: false, showTitle: true, overlayText: false, showParentTitle: true, centerText: true, overlayPlayButton: true }, { name: 'HeaderFavoriteAlbums', types: "MusicAlbum", id: "favoriteAlbums", shape: getSquareShape(), preferThumb: false, showTitle: true, overlayText: false, showParentTitle: true, centerText: true, overlayPlayButton: true }, { name: 'HeaderFavoriteSongs', types: "Audio", id: "favoriteSongs", shape: getSquareShape(), preferThumb: false, showTitle: true, overlayText: false, showParentTitle: true, centerText: true, overlayMoreButton: true, action: 'instantmix' } ]; } function loadSection(elem, userId, topParentId, section, isSingleSection) { var screenWidth = window.innerWidth; var options = { SortBy: "SortName", SortOrder: "Ascending", Filters: "IsFavorite", Recursive: true, Fields: "PrimaryImageAspectRatio,SyncInfo", CollapseBoxSetItems: false, ExcludeLocationTypes: "Virtual", EnableTotalRecordCount: false }; if (topParentId) { options.ParentId = topParentId; } if (!isSingleSection) { options.Limit = screenWidth >= 1920 ? 10 : (screenWidth >= 1440 ? 8 : 6); if (enableScrollX()) { options.Limit = 20; } } var promise; if (section.types == 'MusicArtist') { promise = ApiClient.getArtists(userId, options); } else { options.IncludeItemTypes = section.types; promise = ApiClient.getItems(userId, options); } return promise.then(function (result) { var html = ''; if (result.Items.length) { html += '
'; if (enableScrollX()) { html += '