diff options
author | chriszero <zerov83@gmail.com> | 2015-02-17 19:33:13 +0100 |
---|---|---|
committer | chriszero <zerov83@gmail.com> | 2015-02-17 19:33:13 +0100 |
commit | 216db1e9eb1800df1969ba3fd6755f898a0b2526 (patch) | |
tree | 191d5b4f0c768ba966066a8900288e51ce7c90d6 /Plexservice.cpp | |
parent | 4a86011372c06315b2796f2f4e82c7801027453e (diff) | |
download | vdr-plugin-plex-216db1e9eb1800df1969ba3fd6755f898a0b2526.tar.gz vdr-plugin-plex-216db1e9eb1800df1969ba3fd6755f898a0b2526.tar.bz2 |
Authentication
Diffstat (limited to 'Plexservice.cpp')
-rw-r--r-- | Plexservice.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Plexservice.cpp b/Plexservice.cpp index 76de898..a61caec 100644 --- a/Plexservice.cpp +++ b/Plexservice.cpp @@ -39,10 +39,9 @@ std::string Plexservice::GetMyPlexToken() { static bool done; static std::string myToken; - + //todo: cache token in file or db - if(!done || myToken.empty()) { - std::cout << "Get Token" << std::endl; + if(!done) { std::stringstream ss; Poco::Base64Encoder b64(ss); @@ -77,6 +76,7 @@ std::string Plexservice::GetMyPlexToken() plexSession.detachSocket(); } catch (Poco::Exception &exc) { esyslog("[plex]Exception in %s s%", __func__, exc.displayText().c_str() ); + done = true; } } @@ -120,7 +120,7 @@ std::shared_ptr<MediaContainer> Plexservice::GetSection(std::string section, boo if(section[0]=='/') { // Full URI? uri = section; } else { - uri = Poco::format("%s/%s", m_vUriStack.top(), section);// m_vUriStack.top() + "/" + section; + uri = Poco::format("%s/%s", m_vUriStack.top(), section); } pRequest = CreateRequest(uri); @@ -132,10 +132,10 @@ std::shared_ptr<MediaContainer> Plexservice::GetSection(std::string section, boo Poco::Net::HTTPResponse response; std::istream &rs = m_pPlexSession->receiveResponse(response); - dsyslog("[plex] URI: %s[s%]", m_pPlexSession->getHost().c_str(), pRequest->getURI().c_str()); + dsyslog("[plex] URI: http://%s:32400%s", m_pPlexSession->getHost().c_str(), pRequest->getURI().c_str()); std::shared_ptr<MediaContainer> pAllsections(new MediaContainer(&rs, *pServer)); - //Poco::StreamCopier::copyStream(rs, std::cout); + delete pRequest; return pAllsections; |