コード例 #1
0
        public TVShow CreateTvShowToManager(SearchTv item)
        {
            Genres[] newGenres = new Genres[item.GenreIds.Count];
            for (var k = 0; k < item.GenreIds.Count; k++)
            {
                var id = item.GenreIds[k];
                newGenres[k] = new Genres(id, Manager.TVShowGenres.FirstOrDefault(x => x.ID == id)?.Name);
            }

            var moreInfo = Client.GetTvShowAsync(item.Id).Result;

            Manager.TVShows.Add(new TVShow(item.Id, item.Name, item.Overview, item.FirstAirDate, item.Popularity, item.PosterPath, item.VoteAverage, newGenres, moreInfo.Homepage));
            return(Manager.TVShows.Last());
        }
コード例 #2
0
        public Movie CreateMovieToManager(SearchMovie item)
        {
            Genres[] newGenres = new Genres[item.GenreIds.Count];
            for (var k = 0; k < item.GenreIds.Count; k++)
            {
                var id = item.GenreIds[k];
                newGenres[k] = new Genres(id, Manager.MovieGenres.FirstOrDefault(x => x.ID == id)?.Name);
            }

            var moreInfo = Client.GetMovieAsync(item.Id).Result;

            Manager.Movies.Add(new Movie(item.Id, item.Title, item.Overview, item.ReleaseDate, item.Popularity, item.PosterPath, item.VoteAverage, newGenres, moreInfo.Homepage, moreInfo.Budget, moreInfo.Revenue));
            return(Manager.Movies.Last());
        }