#ifndef PLEXSERVICE_H #define PLEXSERVICE_H //#include "plexgdm.h" #include "PlexServer.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "Config.h" #include "user.h" #include "MediaContainer.h" namespace plexclient { class Plexservice { public: Plexservice(PlexServer *server); ~Plexservice(); void DisplaySections(); std::shared_ptr GetSection(std::string section, bool putOnStack = true); std::shared_ptr GetLastSection(bool current = false); void GetAuthDetails(); void Authenticate(); 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); std::string StartUri; private: Poco::Mutex m_mutex; 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); }; } #endif // PLEXSERVICE_H