(function ($, document, apiClient) { function getSections() { return [ { name: Globalize.translate('HeaderFavoriteMovies'), types: "Movie", id: "favoriteMovies", shape: 'homePageBackdrop', preferThumb: true, showTitle: false }, { name: Globalize.translate('HeaderFavoriteShows'), types: "Series", id: "favoriteShows", shape: 'homePageBackdrop', preferThumb: true, showTitle: false }, { name: Globalize.translate('HeaderFavoriteEpisodes'), types: "Episode", id: "favoriteEpisode", shape: 'homePageBackdrop', preferThumb: false, showTitle: true, showParentTitle: true }, { name: Globalize.translate('HeaderFavoriteGames'), types: "Game", id: "favoriteGames", shape: 'autohome', preferThumb: false, showTitle: true }, { name: Globalize.translate('HeaderFavoriteAlbums'), types: "MusicAlbum", id: "favoriteAlbums", shape: 'homePageSquare', preferThumb: false, showTitle: true, overlayText: false, showParentTitle: true } ]; } function loadSection(elem, userId, section, isSingleSection) { var screenWidth = $(window).width(); var options = { SortBy: isSingleSection ? "SortName" : "Random", SortOrder: "Ascending", IncludeItemTypes: section.types, Filters: "IsFavorite", Limit: screenWidth >= 1920 ? 10 : (screenWidth >= 1440 ? 8 : 6), Recursive: true, Fields: "PrimaryImageAspectRatio", CollapseBoxSetItems: false, ExcludeLocationTypes: "Virtual" }; if (isSingleSection) { options.Limit = null; } ApiClient.getItems(userId, options).done(function (result) { var html = ''; if (result.Items.length) { html += '