diff options
Diffstat (limited to 'libtmdb/tmdb-proxy.cpp')
-rw-r--r-- | libtmdb/tmdb-proxy.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/libtmdb/tmdb-proxy.cpp b/libtmdb/tmdb-proxy.cpp new file mode 100644 index 0000000..7a575e5 --- /dev/null +++ b/libtmdb/tmdb-proxy.cpp @@ -0,0 +1,46 @@ +#include "tmdb-proxy.h" + +namespace TMDb { + Proxy::Proxy(const std::string & bu, const std::string & k) : + HttpClient(bu, k) + { + } + + SearchMultiResultsPtr + Proxy::SearchMulti(const std::string & query, const IceUtil::Optional<int> & page, const Ice::Current&) + { + return GetData<SearchMultiResults>("/search/multi", { { "query", query }, { "page", page } }); + } + + SearchMovieResultsPtr + Proxy::SearchMovies(const std::string & query, const IceUtil::Optional<int> & year, const IceUtil::Optional<int> & page, const Ice::Current&) + { + return GetData<SearchMovieResults>("/search/movies", { { "query", query }, { "page", page }, { "year", year } }); + } + + SearchPersonResultsPtr + Proxy::SearchPersons(const std::string & query, const IceUtil::Optional<int> & page, const Ice::Current&) + { + return GetData<SearchPersonResults>("/search/person", { { "query", query }, { "page", page } }); + } + + SearchTvResultsPtr + Proxy::SearchTv(const std::string & query, const IceUtil::Optional<int> & page, const Ice::Current&) + { + return GetData<SearchTvResults>("/search/tv", { { "query", query}, { "page", page } }); + } + + MoviePtr + Proxy::GetMovie(Ice::Int id, const Ice::Current&) + { + return GetData<Movie, Ice::Int>("/movie/%d", id, { }); + } + + TvSeriesPtr + Proxy::GetTvSeries(Ice::Int id, const Ice::Current&) + { + return GetData<TvSeries, Ice::Int>("/tv/%d", id, { }); + } + +} + |