async Task LoadMovie(int id) { Item = await TMDbService.GetDetailedFilmAsync(id); Item.poster_path = ""; Item.backdrop_path = ""; PosterSource.Clear(); foreach (var posterItem in Item.images.posters) { PosterSource.Add(posterItem); } BackdropSource.Clear(); foreach (var backdropItem in Item.images.backdrops) { BackdropSource.Add(backdropItem); } ReviewSource.Clear(); foreach (var reviewItem in Item.reviews.results) { ReviewSource.Add(reviewItem); } CollectionSource.Clear(); if (Item.belongs_to_collection != null && Item.collection_films != null) { foreach (var collectionItem in Item.collection_films) { CollectionSource.Add(collectionItem); } } RecommendationsSource.Clear(); foreach (var recommendationItem in Item.recommendations.results) { RecommendationsSource.Add(recommendationItem); } CastSource.Clear(); foreach (var castItem in Item.credits.cast) { CastSource.Add(castItem); } CrewSource.Clear(); foreach (var crewItem in Item.credits.crew) { CrewSource.Add(crewItem); } LoadCompleted(); }
async Task LoadTVShow(int id) { Item = await Task.Run(() => TMDbService.GetDetailedTVShowAsync(id)); Item.poster_path = ""; Item.backdrop_path = ""; PosterSource.Clear(); foreach (var posterItem in Item.images.posters) { PosterSource.Add(posterItem); } BackdropSource.Clear(); foreach (var backdropItem in Item.images.backdrops) { BackdropSource.Add(backdropItem); } ReviewSource.Clear(); foreach (var reviewItem in Item.reviews.results) { ReviewSource.Add(reviewItem); } RecommendationsSource.Clear(); foreach (var recommendationItem in Item.recommendations.results) { RecommendationsSource.Add(recommendationItem); } CastSource.Clear(); foreach (var castItem in Item.credits.cast) { CastSource.Add(castItem); } CrewSource.Clear(); foreach (var crewItem in Item.credits.crew) { CrewSource.Add(crewItem); } SeasonSource.Clear(); foreach (var seasonItem in Item.seasons) { SeasonSource.Add(seasonItem); } LoadCompleted(); }