using System.Collections.Generic; using System.Threading.Tasks; using TMDbLib.Client; using TMDbLib.Objects.General; using TMDbLib.Objects.Movies; using TMDbLib.Objects.Search; using TMDbLib.Objects.TvShows; namespace RequestPlex.Api { public class TheMovieDbApi : MovieBase { public TheMovieDbApi() { Client = new TMDbClient(ApiKey); } public TMDbClient Client { get; set; } public async Task> SearchMovie(string searchTerm) { var results = await Client.SearchMovie(searchTerm); return results.Results; } public async Task> SearchTv(string searchTerm) { var results = await Client.SearchTvShow(searchTerm); return results.Results; } public async Task> GetCurrentPlayingMovies() { var movies = await Client.GetMovieList(MovieListType.NowPlaying); return movies.Results; } public async Task> GetUpcomingMovies() { var movies = await Client.GetMovieList(MovieListType.Upcoming); return movies.Results; } public async Task GetMovieInformation(int tmdbId) { var movies = await Client.GetMovie(tmdbId); return movies; } public async Task GetTvShowInformation(int tmdbId) { var show = await Client.GetTvShow(tmdbId); return show; } } }