diff options
author | chriszero <zerov83@gmail.com> | 2015-02-15 22:17:20 +0100 |
---|---|---|
committer | chriszero <zerov83@gmail.com> | 2015-02-15 22:17:20 +0100 |
commit | 6255bbe09625828312e08835bb30d5822d600e46 (patch) | |
tree | 6217475a4f3a9fa075a181f7972f0c99db387a7f /Plexservice.h | |
parent | e412257abf8de4576a180351d24ff07589fa630c (diff) | |
download | vdr-plugin-plex-6255bbe09625828312e08835bb30d5822d600e46.tar.gz vdr-plugin-plex-6255bbe09625828312e08835bb30d5822d600e46.tar.bz2 |
Faster response.
Modified Plexservice for future additions.
Diffstat (limited to 'Plexservice.h')
-rw-r--r-- | Plexservice.h | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/Plexservice.h b/Plexservice.h index cccf17b..af7275d 100644 --- a/Plexservice.h +++ b/Plexservice.h @@ -7,7 +7,7 @@ #include <sstream> #include <iostream> #include <string> -#include <vector> +#include <stack> #include <stdio.h> #include <stdlib.h> #include <memory> @@ -43,28 +43,24 @@ public: ~Plexservice(); void DisplaySections(); - MediaContainer* GetAllSections(); - MediaContainer* GetSection(std::string section); + std::shared_ptr<MediaContainer> GetSection(std::string section, bool putOnStack = true); + std::shared_ptr<MediaContainer> 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<std::string> m_vUriStack; + Poco::Net::HTTPClientSession* GetHttpSession(bool createNew = false); Poco::Net::HTTPRequest* CreateRequest(std::string path); }; |