Esempio n. 1
0
        public async Task LoadAsync(bool refresh = false)
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            if (IsMultiSeason)
            {
                FeaturedVideo = await _animeService.GetLatestEpisodeAsync();

                var seasons = await _seasonService.ListAsync(new DataServices.ListRequest {
                    Skip = refresh ? 0 : Seasons.Count
                });

                Seasons.Clear();
                Seasons.AddRange(seasons);

                foreach (var season in Seasons)
                {
                    var episodes = await _animeService.ListEpisodeBySeasonAsync(new ListEpisodeBySeasonRequest { SeasonId = season.Id, Take = 5 });

                    season.Episodes.AddRange(episodes);
                }
            }
            else
            {
                List <Anime> animes = null;
                if (DataSource.ToLower() == "tvspecials")
                {
                    FeaturedVideo = await _animeService.GetLatestTvSpecialAsync();

                    animes = await _animeService.ListTvSpecialsAsync(new DataServices.ListRequest {
                        Skip = refresh ? 0 : Animes.Count
                    });
                }
                else if (DataSource.ToLower() == "movies")
                {
                    FeaturedVideo = await _animeService.GetLatestMovieAsync();

                    animes = await _animeService.ListMoviesAsync(new DataServices.ListRequest {
                        Skip = refresh ? 0 : Animes.Count
                    });
                }

                if (animes != null)
                {
                    Animes.Clear();
                    Animes.AddRange(animes);
                }
            }

            IsBusy = false;
        }
Esempio n. 2
0
        private async Task ResetAndLoadGlobalAsync()
        {
            _originalCollection.Clear();
            Animes.Clear();
            _pageCount = 1;
            ClearTextQuery();
            RemainingAnimeCount = 0;
            Loading             = true;
            await LoadGlobalCatalogueAsync();

            Loading = false;
        }
        public async void Load()
        {
            IsBusy = true;
            var result = await App.AzureClient.GetAnimes();

            Animes.Clear();

            foreach (var item in result)
            {
                Animes.Add(item);
            }
            IsBusy = false;
        }
        public async Task LoadAsync()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            _appDataStorage.SaveAnime(Anime);

            List <Anime> animes = null;

            switch (AnimeType.ToLower())
            {
            case "stories":
                animes = await _animeService.ListStoriesAsync(new DataServices.ListRequest {
                    Skip = Animes.Count
                });

                break;

            case "tvspecials":
                animes = await _animeService.ListTvSpecialsAsync(new DataServices.ListRequest {
                    Skip = Animes.Count
                });

                break;

            case "movies":
                animes = await _animeService.ListMoviesAsync(new DataServices.ListRequest {
                    Skip = Animes.Count
                });

                break;
            }

            Animes.Clear();
            Animes.AddRange(animes);

            var seasons = await _seasonService.ListAsync(new DataServices.ListRequest {
                Skip = Seasons.Count
            });

            Seasons.Clear();
            Seasons.AddRange(seasons);

            IsBusy = false;
        }
Esempio n. 5
0
        public async Task LoadAsync(bool refresh = false)
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            var animes = await _animeService.ListEpisodeBySeasonAsync(new ListEpisodeBySeasonRequest { Skip = refresh ? 0 : Animes.Count, SeasonId = Season.Id });

            if (animes != null)
            {
                Animes.Clear();
                Animes.AddRange(animes);
            }

            IsBusy = false;
        }