summaryrefslogtreecommitdiff
path: root/PlexReqHandlerFactory.cpp
diff options
context:
space:
mode:
authorchriszero <zerov83@gmail.com>2015-02-05 21:32:55 +0100
committerchriszero <zerov83@gmail.com>2015-02-05 21:32:55 +0100
commit312c13f4f6b299a976787542869f96b1e66549cf (patch)
tree7ee2732eaec79d50e0c9718960fd58e2436f10f6 /PlexReqHandlerFactory.cpp
parent1ecdb2a5d9e05e0d30dae89e3d675218ca4c255e (diff)
downloadvdr-plugin-plex-312c13f4f6b299a976787542869f96b1e66549cf.tar.gz
vdr-plugin-plex-312c13f4f6b299a976787542869f96b1e66549cf.tar.bz2
Plex remote support.
Control via Plexapps (Android, IOS...)
Diffstat (limited to 'PlexReqHandlerFactory.cpp')
-rw-r--r--PlexReqHandlerFactory.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/PlexReqHandlerFactory.cpp b/PlexReqHandlerFactory.cpp
index 1b68bcb..ec33a12 100644
--- a/PlexReqHandlerFactory.cpp
+++ b/PlexReqHandlerFactory.cpp
@@ -12,21 +12,22 @@ PlexReqHandlerFactory::~PlexReqHandlerFactory()
}
Poco::Net::HTTPRequestHandler* PlexReqHandlerFactory::createRequestHandler(const Poco::Net::HTTPServerRequest& request)
-{
+{
if(request.getMethod() == Poco::Net::HTTPRequest::HTTP_GET) {
std::cout << "GET Request: " << request.getURI() << " from: " << request.clientAddress().toString() << std::endl;
- }
- else if(request.getMethod() == Poco::Net::HTTPRequest::HTTP_OPTIONS) {
+ } else if(request.getMethod() == Poco::Net::HTTPRequest::HTTP_OPTIONS) {
std::cout << "OPTIONS Request: " << request.getURI() << " from: " << request.clientAddress().toString() << std::endl;
- }
- else if(request.getMethod() == Poco::Net::HTTPRequest::HTTP_HEAD) {
+ } else if(request.getMethod() == Poco::Net::HTTPRequest::HTTP_HEAD) {
std::cout << "HEAD Request: " << request.getURI() << " from: " << request.clientAddress().toString() << std::endl;
}
-
- if(request.getURI().find("/subscribe")!= std::string::npos) return new SubscribeRequestHandler();
+ else {
+ std::cout << "??? Request: " << request.getURI() << " from: " << request.clientAddress().toString() << std::endl;
+ }
+
+ if(request.getURI().find("/player/timeline")!= std::string::npos) return new SubscribeRequestHandler();
else if(request.getURI().find("/resources")!= std::string::npos) return new ResourceRequestHandler();
else if(request.getURI().find("/player")!= std::string::npos) return new PlayerRequestHandler();
-
+
return new PlexHTTPRequestHandler();
}