From 7b64bf5062f3eb6ddff5d7606e44367bd5077e4c Mon Sep 17 00:00:00 2001
From: chriszero <zerov83@gmail.com>
Date: Tue, 15 Dec 2015 22:15:35 +0100
Subject: Added SSL support, started support for remote resources (servers).
 Browsing remote servers is working. plex.tv login is mandatory.

---
 PlexServer.h | 31 +++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)

(limited to 'PlexServer.h')

diff --git a/PlexServer.h b/PlexServer.h
index 0a36adb..e530aa9 100644
--- a/PlexServer.h
+++ b/PlexServer.h
@@ -10,6 +10,7 @@
 
 #include <Poco/String.h>
 #include <Poco/Net/HTTPClientSession.h>
+#include <Poco/Net/HTTPSClientSession.h>
 #include <Poco/Net/HTTPRequest.h>
 #include <Poco/Net/MessageHeader.h>
 #include <Poco/URI.h>
@@ -21,17 +22,17 @@ class PlexServer
 {
 	friend class plexgdm;
 
-public:
+	public:
+	PlexServer(std::string uri, std::string name, std::string uuid, std::string accessToken, bool owned, bool local);
+	~PlexServer();
+	
 	int GetMaster() const {
 		return m_nMaster;
 	}
 
-	int GetOwned() const {
+	int IsOwned() const {
 		return m_nOwned;
 	}
-	int GetPort() const {
-		return m_nPort;
-	}
 	const std::string& GetContentType() const {
 		return m_sContentType;
 	}
@@ -53,11 +54,19 @@ public:
 	const std::string& GetVersion() const {
 		return m_sVersion;
 	}
-	const std::string& GetIpAdress() const {
-		return m_sIpAddress;
+	const std::string& GetAuthToken() const {
+		return m_authToken;
 	}
-
+	const bool& IsLocal() const {
+		return m_bLocal;
+	}
+	
+	std::string GetHost();
+	int GetPort();
+	
 	std::string GetUri();
+	
+	Poco::Net::HTTPClientSession* GetClientSession();
 
 	void DiscoverSettings();
 	bool Offline;
@@ -73,15 +82,17 @@ private:
 	std::string m_sDiscovery;
 
 	int m_nOwned;
+	bool m_bLocal;
 	int m_nMaster;
 	std::string m_sRole;
 	std::string m_sContentType;
 	std::string m_sUuid;
 	std::string m_sServerName;
-	std::string m_sIpAddress;
-	int m_nPort;
+	std::string m_uri;
+	std::string m_authToken;
 	long m_nUpdated;
 	std::string m_sVersion;
+	Poco::Net::HTTPClientSession* m_httpSession;
 
 };
 
-- 
cgit v1.2.3