Added the option to import the plex admin.

Fixed #1701
This commit is contained in:
tidusjar 2017-11-10 20:27:14 +00:00
parent 1813b45fb3
commit 560072eba4
33 changed files with 279 additions and 91 deletions

View file

@ -18,7 +18,7 @@ namespace Ombi.Api.Plex
private const string SignInUri = "https://plex.tv/users/sign_in.json";
private const string FriendsUri = "https://plex.tv/pms/friends/all";
private const string GetAccountUri = "https://plex.tv/users/account";
private const string GetAccountUri = "https://plex.tv/users/account.json";
private const string ServerUri = "https://plex.tv/pms/servers.xml";
/// <summary>
@ -52,6 +52,13 @@ namespace Ombi.Api.Plex
return await Api.Request<PlexStatus>(request);
}
public async Task<PlexAccount> GetAccount(string authToken)
{
var request = new Request(GetAccountUri, string.Empty, HttpMethod.Get);
AddHeaders(request, authToken);
return await Api.Request<PlexAccount>(request);
}
public async Task<PlexServer> GetServer(string authToken)
{
var request = new Request(ServerUri, string.Empty, HttpMethod.Get, ContentType.Xml);