The move!

This commit is contained in:
Jamie.Rees 2017-05-16 08:31:44 +01:00
commit 25526cc4d9
1147 changed files with 85 additions and 8524 deletions

View file

@ -0,0 +1,19 @@
using System.Threading.Tasks;
using Ombi.Api.Plex.Models;
using Ombi.Api.Plex.Models.Server;
using Ombi.Api.Plex.Models.Status;
namespace Ombi.Api.Plex
{
public interface IPlexApi
{
Task<PlexStatus> GetStatus(string authToken, string uri);
Task<PlexAuthentication> SignIn(UserRequest user);
Task<PlexServer> GetServer(string authToken);
Task<PlexLibraries> GetLibrarySections(string authToken, string plexFullHost);
Task<PlexLibraries> GetLibrary(string authToken, string plexFullHost, string libraryId);
Task<PlexMetadata> GetEpisodeMetaData(string authToken, string host, string ratingKey);
Task<PlexMetadata> GetMetadata(string authToken, string plexFullHost, string itemId);
Task<PlexMetadata> GetSeasons(string authToken, string plexFullHost, string ratingKey);
}
}

View file

@ -0,0 +1,9 @@
namespace Ombi.Api.Plex.Models
{
public class Director
{
public int id { get; set; }
public string filter { get; set; }
public string tag { get; set; }
}
}

View file

@ -0,0 +1,41 @@
using System.Collections.Generic;
using System.Xml.Serialization;
namespace Ombi.Api.Plex.Models
{
public class Directory
{
public Directory()
{
seasons = new List<Directory>();
}
public bool allowSync { get; set; }
public string art { get; set; }
public string composite { get; set; }
public bool filters { get; set; }
public bool refreshing { get; set; }
public string thumb { get; set; }
public string key { get; set; }
public string type { get; set; }
public string title { get; set; }
public string agent { get; set; }
public string scanner { get; set; }
public string language { get; set; }
public string uuid { get; set; }
public int updatedAt { get; set; }
public int createdAt { get; set; }
public Location[] Location { get; set; }
public string providerId { get; set; }
public string guid { get; set; }
public List<Genre> genre { get; set; }
public List<Role> role { get; set; }
public string librarySectionID { get; set; }
public string librarySectionTitle { get; set; }
public string librarySectionUUID { get; set; }
public string personal { get; set; }
public string sourceTitle { get; set; }
public string ratingKey { get; set; }
public string studio { get; set; }
public List<Directory> seasons { get; set; }
}
}

View file

@ -0,0 +1,7 @@
namespace Ombi.Api.Plex.Models
{
public class Genre
{
public string tag { get; set; }
}
}

View file

@ -0,0 +1,8 @@
namespace Ombi.Api.Plex.Models
{
public class Location
{
public int id { get; set; }
public string path { get; set; }
}
}

View file

@ -0,0 +1,26 @@
using System.Collections.Generic;
namespace Ombi.Api.Plex.Models
{
public class Mediacontainer
{
public int size { get; set; }
public bool allowSync { get; set; }
public string identifier { get; set; }
public string mediaTagPrefix { get; set; }
public int mediaTagVersion { get; set; }
public string title1 { get; set; }
public List<Directory> Directory { get; set; }
public string art { get; set; }
public int librarySectionID { get; set; }
public string librarySectionTitle { get; set; }
public string librarySectionUUID { get; set; }
public bool nocache { get; set; }
public string thumb { get; set; }
public string title2 { get; set; }
public string viewGroup { get; set; }
public int viewMode { get; set; }
public Metadata[] Metadata { get; set; }
}
}

View file

@ -0,0 +1,21 @@
namespace Ombi.Api.Plex.Models
{
public class Medium
{
public string videoResolution { get; set; }
public int id { get; set; }
public int duration { get; set; }
public int bitrate { get; set; }
public int width { get; set; }
public int height { get; set; }
public float aspectRatio { get; set; }
public int audioChannels { get; set; }
public string audioCodec { get; set; }
public string videoCodec { get; set; }
public string container { get; set; }
public string videoFrameRate { get; set; }
public string audioProfile { get; set; }
public string videoProfile { get; set; }
public Part[] Part { get; set; }
}
}

View file

@ -0,0 +1,50 @@
namespace Ombi.Api.Plex.Models
{
public class Metadata
{
public string ratingKey { get; set; }
public string key { get; set; }
public string studio { get; set; }
public string type { get; set; }
public string title { get; set; }
public string contentRating { get; set; }
public string summary { get; set; }
public int index { get; set; }
public float rating { get; set; }
public int viewCount { get; set; }
public int lastViewedAt { get; set; }
public int year { get; set; }
public string thumb { get; set; }
public string art { get; set; }
public string banner { get; set; }
public string theme { get; set; }
public string duration { get; set; }
public string originallyAvailableAt { get; set; }
public int leafCount { get; set; }
public int viewedLeafCount { get; set; }
public int childCount { get; set; }
public int addedAt { get; set; }
public int updatedAt { get; set; }
public Genre[] Genre { get; set; }
public Role[] Role { get; set; }
public string primaryExtraKey { get; set; }
public string parentRatingKey { get; set; }
public string grandparentRatingKey { get; set; }
public string guid { get; set; }
public int librarySectionID { get; set; }
public string librarySectionKey { get; set; }
public string grandparentKey { get; set; }
public string parentKey { get; set; }
public string grandparentTitle { get; set; }
public string parentTitle { get; set; }
public int parentIndex { get; set; }
public string parentThumb { get; set; }
public string grandparentThumb { get; set; }
public string grandparentArt { get; set; }
public string grandparentTheme { get; set; }
public string chapterSource { get; set; }
public Medium[] Media { get; set; }
public Director[] Director { get; set; }
public Writer[] Writer { get; set; }
}
}

View file

@ -0,0 +1,15 @@
namespace Ombi.Api.Plex.Models
{
public class Part
{
public int id { get; set; }
public string key { get; set; }
public string duration { get; set; }
public string file { get; set; }
public string size { get; set; }
public string audioProfile { get; set; }
public string container { get; set; }
public string videoProfile { get; set; }
public Stream[] Stream { get; set; }
}
}

View file

@ -0,0 +1,10 @@
using System;
using System.Text;
namespace Ombi.Api.Plex.Models
{
public class PlexAuthentication
{
public User user { get; set; }
}
}

View file

@ -0,0 +1,33 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2017 Jamie Rees
// File: Library.cs
// Created By: Jamie Rees
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace Ombi.Api.Plex.Models
{
public class PlexLibraries
{
public Mediacontainer MediaContainer { get; set; }
}
}

View file

@ -0,0 +1,33 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2017 Jamie Rees
// File: PlexMetadata.cs
// Created By: Jamie Rees
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace Ombi.Api.Plex.Models
{
public class PlexMetadata
{
public Mediacontainer MediaContainer { get; set; }
}
}

View file

@ -0,0 +1,33 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2017 Jamie Rees
// File: PlexUserRequest.cs
// Created By: Jamie Rees
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace Ombi.Api.Plex.Models
{
public class PlexUserRequest
{
public UserRequest user { get; set; }
}
}

View file

@ -0,0 +1,7 @@
namespace Ombi.Api.Plex.Models
{
public class Role
{
public string tag { get; set; }
}
}

View file

@ -0,0 +1,9 @@
using System.Collections.Generic;
namespace Ombi.Api.Plex.Models
{
public class Roles
{
public List<object> roles { get; set; }
}
}

View file

@ -0,0 +1,47 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2017 Jamie Rees
// File: PlexServer.cs
// Created By: Jamie Rees
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System.Collections.Generic;
using System.Xml.Serialization;
namespace Ombi.Api.Plex.Models.Server
{
[XmlRoot(ElementName = "MediaContainer")]
public class PlexServer
{
[XmlElement(ElementName = "Server")]
public List<ServerInfo> Server { get; set; }
[XmlAttribute(AttributeName = "friendlyName")]
public string FriendlyName { get; set; }
[XmlAttribute(AttributeName = "identifier")]
public string Identifier { get; set; }
[XmlAttribute(AttributeName = "machineIdentifier")]
public string MachineIdentifier { get; set; }
[XmlAttribute(AttributeName = "size")]
public string Size { get; set; }
}
}

View file

@ -0,0 +1,41 @@
using System.Xml.Serialization;
namespace Ombi.Api.Plex.Models.Server
{
[XmlRoot(ElementName = "Server")]
public class ServerInfo
{
[XmlAttribute(AttributeName = "accessToken")]
public string AccessToken { get; set; }
[XmlAttribute(AttributeName = "name")]
public string Name { get; set; }
[XmlAttribute(AttributeName = "address")]
public string Address { get; set; }
[XmlAttribute(AttributeName = "port")]
public string Port { get; set; }
[XmlAttribute(AttributeName = "version")]
public string Version { get; set; }
[XmlAttribute(AttributeName = "scheme")]
public string Scheme { get; set; }
[XmlAttribute(AttributeName = "host")]
public string Host { get; set; }
[XmlAttribute(AttributeName = "localAddresses")]
public string LocalAddresses { get; set; }
[XmlAttribute(AttributeName = "machineIdentifier")]
public string MachineIdentifier { get; set; }
[XmlAttribute(AttributeName = "createdAt")]
public string CreatedAt { get; set; }
[XmlAttribute(AttributeName = "updatedAt")]
public string UpdatedAt { get; set; }
[XmlAttribute(AttributeName = "owned")]
public string Owned { get; set; }
[XmlAttribute(AttributeName = "synced")]
public string Synced { get; set; }
[XmlAttribute(AttributeName = "sourceTitle")]
public string SourceTitle { get; set; }
[XmlAttribute(AttributeName = "ownerId")]
public string OwnerId { get; set; }
[XmlAttribute(AttributeName = "home")]
public string Home { get; set; }
}
}

View file

@ -0,0 +1,9 @@
namespace Ombi.Api.Plex.Models.Status
{
public class Directory
{
public int count { get; set; }
public string key { get; set; }
public string title { get; set; }
}
}

View file

@ -0,0 +1,51 @@
namespace Ombi.Api.Plex.Models.Status
{
public class Mediacontainer
{
public int size { get; set; }
public bool allowCameraUpload { get; set; }
public bool allowChannelAccess { get; set; }
public bool allowMediaDeletion { get; set; }
public bool allowSharing { get; set; }
public bool allowSync { get; set; }
public bool backgroundProcessing { get; set; }
public bool certificate { get; set; }
public bool companionProxy { get; set; }
public string countryCode { get; set; }
public string diagnostics { get; set; }
public bool eventStream { get; set; }
public string friendlyName { get; set; }
public bool hubSearch { get; set; }
public bool itemClusters { get; set; }
public string machineIdentifier { get; set; }
public bool mediaProviders { get; set; }
public bool multiuser { get; set; }
public bool myPlex { get; set; }
public string myPlexMappingState { get; set; }
public string myPlexSigninState { get; set; }
public bool myPlexSubscription { get; set; }
public string myPlexUsername { get; set; }
public bool photoAutoTag { get; set; }
public string platform { get; set; }
public string platformVersion { get; set; }
public bool pluginHost { get; set; }
public bool readOnlyLibraries { get; set; }
public bool requestParametersInCookie { get; set; }
public int streamingBrainVersion { get; set; }
public bool sync { get; set; }
public int transcoderActiveVideoSessions { get; set; }
public bool transcoderAudio { get; set; }
public bool transcoderLyrics { get; set; }
public bool transcoderPhoto { get; set; }
public bool transcoderSubtitles { get; set; }
public bool transcoderVideo { get; set; }
public string transcoderVideoBitrates { get; set; }
public string transcoderVideoQualities { get; set; }
public string transcoderVideoResolutions { get; set; }
public int updatedAt { get; set; }
public bool updater { get; set; }
public string version { get; set; }
public bool voiceSearch { get; set; }
public Directory[] Directory { get; set; }
}
}

View file

@ -0,0 +1,34 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2017 Jamie Rees
// File: PlexStatus.cs
// Created By: Jamie Rees
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace Ombi.Api.Plex.Models.Status
{
public class PlexStatus
{
public Mediacontainer MediaContainer { get; set; }
}
}

View file

@ -0,0 +1,28 @@
namespace Ombi.Api.Plex.Models
{
public class Stream
{
public int id { get; set; }
public int streamType { get; set; }
public bool _default { get; set; }
public string codec { get; set; }
public int index { get; set; }
public int bitrate { get; set; }
public int bitDepth { get; set; }
public string chromaSubsampling { get; set; }
public float frameRate { get; set; }
public bool hasScalingMatrix { get; set; }
public int height { get; set; }
public int level { get; set; }
public string profile { get; set; }
public int refFrames { get; set; }
public string scanType { get; set; }
public int width { get; set; }
public int channels { get; set; }
public string language { get; set; }
public string languageCode { get; set; }
public string audioChannelLayout { get; set; }
public int samplingRate { get; set; }
public bool selected { get; set; }
}
}

View file

@ -0,0 +1,10 @@
namespace Ombi.Api.Plex.Models
{
public class Subscription
{
public bool active { get; set; }
public string status { get; set; }
public object plan { get; set; }
public object features { get; set; }
}
}

View file

@ -0,0 +1,19 @@
using System.Collections.Generic;
namespace Ombi.Api.Plex.Models
{
public class User
{
public string email { get; set; }
public string uuid { get; set; }
public string joined_at { get; set; }
public string username { get; set; }
public string title { get; set; }
public string authentication_token { get; set; }
public Subscription subscription { get; set; }
public Roles roles { get; set; }
public List<string> entitlements { get; set; }
public object confirmed_at { get; set; }
public int forum_id { get; set; }
}
}

View file

@ -0,0 +1,8 @@
namespace Ombi.Api.Plex.Models
{
public class UserRequest
{
public string login { get; set; }
public string password { get; set; }
}
}

View file

@ -0,0 +1,9 @@
namespace Ombi.Api.Plex.Models
{
public class Writer
{
public int id { get; set; }
public string filter { get; set; }
public string tag { get; set; }
}
}

View file

@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.6</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Xml.XmlSerializer" Version="4.3.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Ombi.Api\Ombi.Api.csproj" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,135 @@
using System;
using System.Net.Http;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Ombi.Api.Plex.Models;
using Ombi.Api.Plex.Models.Server;
using Ombi.Api.Plex.Models.Status;
namespace Ombi.Api.Plex
{
public class PlexApi : IPlexApi
{
public PlexApi()
{
Api = new Api();
}
private Api Api { get; }
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 ServerUri = "https://plex.tv/pms/servers.xml";
/// <summary>
/// Sign into the Plex API
/// This is for authenticating users credentials with Plex
/// <para>NOTE: Plex "Managed" users do not work</para>
/// </summary>
/// <param name="username"></param>
/// <param name="password"></param>
/// <returns></returns>
public async Task<PlexAuthentication> SignIn(UserRequest user)
{
var userModel = new PlexUserRequest
{
user = user
};
var request = new Request(SignInUri, string.Empty, HttpMethod.Post);
AddHeaders(request);
request.AddJsonBody(userModel);
var obj = await Api.Request<PlexAuthentication>(request);
return obj;
}
public async Task<PlexStatus> GetStatus(string authToken, string uri)
{
var request = new Request(uri, string.Empty, HttpMethod.Get);
AddHeaders(request, authToken);
return await Api.Request<PlexStatus>(request);
}
public async Task<PlexServer> GetServer(string authToken)
{
var request = new Request(ServerUri, string.Empty, HttpMethod.Get, ContentType.Xml);
AddHeaders(request, authToken);
return await Api.Request<PlexServer>(request);
}
public async Task<PlexLibraries> GetLibrarySections(string authToken, string plexFullHost)
{
var request = new Request("library/sections", plexFullHost, HttpMethod.Get);
AddHeaders(request, authToken);
return await Api.Request<PlexLibraries>(request);
}
public async Task<PlexLibraries> GetLibrary(string authToken, string plexFullHost, string libraryId)
{
var request = new Request($"library/sections/{libraryId}/all", plexFullHost, HttpMethod.Get);
AddHeaders(request, authToken);
return await Api.Request<PlexLibraries>(request);
}
/// <summary>
// 192.168.1.69:32400/library/metadata/3662/allLeaves
// The metadata ratingkey should be in the Cache
// Search for it and then call the above with the Directory.RatingKey
// THEN! We need the episode metadata using result.Vide.Key ("/library/metadata/3664")
// We then have the GUID which contains the TVDB ID plus the season and episode number: guid="com.plexapp.agents.thetvdb://269586/2/8?lang=en"
/// </summary>
/// <param name="authToken"></param>
/// <param name="plexFullHost"></param>
/// <param name="ratingKey"></param>
/// <returns></returns>
public async Task<PlexMetadata> GetEpisodeMetaData(string authToken, string plexFullHost, string ratingKey)
{
var request = new Request($"/library/metadata/{ratingKey}", plexFullHost, HttpMethod.Get);
AddHeaders(request, authToken);
return await Api.Request<PlexMetadata>(request);
}
public async Task<PlexMetadata> GetMetadata(string authToken, string plexFullHost, string itemId)
{
var request = new Request($"library/metadata/{itemId}", plexFullHost, HttpMethod.Get);
AddHeaders(request, authToken);
return await Api.Request<PlexMetadata>(request);
}
public async Task<PlexMetadata> GetSeasons(string authToken, string plexFullHost, string ratingKey)
{
var request = new Request($"library/metadata/{ratingKey}/children", plexFullHost, HttpMethod.Get);
AddHeaders(request, authToken);
return await Api.Request<PlexMetadata>(request);
}
/// <summary>
/// Adds the required headers and also the authorization header
/// </summary>
/// <param name="request"></param>
/// <param name="authToken"></param>
private void AddHeaders(Request request, string authToken)
{
request.AddHeader("X-Plex-Token", authToken);
AddHeaders(request);
}
/// <summary>
/// Adds the main required headers to the Plex Request
/// </summary>
/// <param name="request"></param>
private void AddHeaders(Request request)
{
request.AddHeader("X-Plex-Client-Identifier", $"OmbiV3");
request.AddHeader("X-Plex-Product", "Ombi");
request.AddHeader("X-Plex-Version", "3");
request.AddContentHeader("Content-Type", request.ContentType == ContentType.Json ? "application/json" : "application/xml");
request.AddHeader("Accept", "application/json");
}
}
}