Esempio n. 1
0
        //Search for Series
        public async Task DiscoverSeries()
        {
            //API needs %2C between keywords
            Keyword.Replace(",", "%2C");
            //Create new service and get series informations in a SeriesGroup
            var service    = new MovieService();
            var discovered = await service.GetDiscoverSeriesAsync(Media, Language, SortDecreasing, Vote, Keyword);

            //Get the list of genres and choose the one out that user was looking for
            var genreList = await service.GetGenres(Media);

            foreach (var item in genreList.genres)
            {
                if (Genre == item.name)
                {
                    ChosenGenre = item;
                }
            }
            //Clear up the DiscoverSerieses so it would not contain old data
            DiscoveredSeries.Clear();
            //Fill up DiscoveredSeries if the items meet requirements
            foreach (var item in discovered.results)
            {
                if (item.genre_ids.Contains(ChosenGenre.id))
                {
                    DiscoveredSeries.Add((Series)item);
                }
            }
            NavigationService.Navigate(typeof(SeriesListPage), DiscoveredSeries);
        }
Esempio n. 2
0
        public async Task DiscoverTrendingSeries()
        {
            //Create service and get data from API
            var service    = new MovieService();
            var discovered = await service.GetTrendingSeries(Timer);

            DiscoveredSeries.Clear();
            //Fill up the emptied DiscoveredSeries with elements that meet requirements
            foreach (var item in discovered.results)
            {
                DiscoveredSeries.Add(item);
            }
            NavigationService.Navigate(typeof(SeriesListPage), DiscoveredSeries);
        }