Esempio n. 1
0
        private async Task NavigateToMoviesInternal(string indexValue)
        {
            var item = await GetRootFolder();

            var displayPreferences = await PresentationManager.GetDisplayPreferences("Movies", CancellationToken.None);

            var view = _moviesView ?? await ApiClient.GetMovieView(_sessionManager.CurrentUser.Id, ParentId, CancellationToken.None);

            var tabs = new List <TabItem>();

            tabs.Add(new TabItem
            {
                DisplayName = "All Movies",
                Name        = "AllMovies"
            });

            tabs.Add(new TabItem
            {
                DisplayName = "Unwatched",
                Name        = "Unwatched",
            });

            tabs.Add(new TabItem
            {
                DisplayName = "New Releases",
                Name        = "NewReleases",
            });

            tabs.Add(new TabItem
            {
                DisplayName = "Trailers",
                Name        = "Trailers",
            });

            tabs.Add(new TabItem
            {
                DisplayName = "Favorites",
                Name        = "FavoriteMovies"
            });

            if (view.BoxSetItems.Count > 0)
            {
                tabs.Add(new TabItem
                {
                    DisplayName = "Box Sets",
                    Name        = "BoxSets",
                });
            }

            if (view.FamilyMovies.Count > 0)
            {
                tabs.Add(new TabItem
                {
                    DisplayName = "Family",
                    Name        = "Family",
                });
            }

            tabs.Add(new TabItem
            {
                DisplayName = "Popular",
                Name        = "TopRated",
            });

            tabs.Add(new TabItem
            {
                DisplayName = "Critically Acclaimed",
                Name        = "TopCriticRated",
            });

            if (view.ThreeDItems.Count > 0)
            {
                tabs.Add(new TabItem
                {
                    DisplayName = "3D Movies",
                    Name        = "3DMovies",
                });
            }

            var options = new ListPageConfig
            {
                PageTitle       = " ",
                CustomItemQuery = GetMovies,
                IndexOptions    = tabs,
                IndexValue      = indexValue,
                SortOptions     = GetMovieSortOptions()
            };

            SetDefaults(options);

            var page = new FolderPage(item, displayPreferences, ApiClient, _imageManager, PresentationManager, _navService, _playbackManager, _logger, _serverEvents, options)
            {
                ViewType = ViewType.Movies
            };

            await _navService.Navigate(page);
        }