diff options
author | randomdan <randomdan@localhost> | 2014-09-19 23:52:30 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2014-09-19 23:52:30 +0000 |
commit | 28691c29e93fbc4fdb5ae4866287282840fba021 (patch) | |
tree | 8b83ca80afc3f3a5d11b04a56c440d2aa38f4e16 /libtmdb/tmdb-proxy.cpp | |
parent | Support muxing directly in storage (diff) | |
download | p2pvr-28691c29e93fbc4fdb5ae4866287282840fba021.tar.bz2 p2pvr-28691c29e93fbc4fdb5ae4866287282840fba021.tar.xz p2pvr-28691c29e93fbc4fdb5ae4866287282840fba021.zip |
First bash at a slicer ice proxy for TMDb and an untested instantiation in p2pvr's core adapter
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, { }); + } + +} + |