From 6255bbe09625828312e08835bb30d5822d600e46 Mon Sep 17 00:00:00 2001 From: chriszero Date: Sun, 15 Feb 2015 22:17:20 +0100 Subject: Faster response. Modified Plexservice for future additions. --- Plexservice.h | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'Plexservice.h') diff --git a/Plexservice.h b/Plexservice.h index cccf17b..af7275d 100644 --- a/Plexservice.h +++ b/Plexservice.h @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include @@ -43,28 +43,24 @@ public: ~Plexservice(); void DisplaySections(); - MediaContainer* GetAllSections(); - MediaContainer* GetSection(std::string section); + std::shared_ptr GetSection(std::string section, bool putOnStack = true); + std::shared_ptr GetLastSection(); void GetAuthDetails(); - std::string GetMyPlexToken(); void Authenticate(); - //void DiscoverFirstServer(); + PlexServer* GetServer(); static std::string GetUniversalTranscodeUrl(Video* video, int offset = 0, PlexServer* server = 0); - + static std::string GetMyPlexToken(); static MediaContainer GetMediaContainer(std::string fullUrl); static std::string encode(std::string message); private: Poco::Mutex m_mutex; - // Never Access m_sToken directly! => possible race condition - std::string m_sToken; - - std::string USERAGENT; - Poco::Net::HTTPClientSession *m_pPlexSession; PlexServer *pServer; + std::stack m_vUriStack; + Poco::Net::HTTPClientSession* GetHttpSession(bool createNew = false); Poco::Net::HTTPRequest* CreateRequest(std::string path); }; -- cgit v1.2.3