|
|
|
@ -1,3 +1,4 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.Net.Http;
|
|
|
|
|
using NLog;
|
|
|
|
|
using NzbDrone.Common.Extensions;
|
|
|
|
@ -75,6 +76,7 @@ namespace NzbDrone.Core.Notifications.Trakt
|
|
|
|
|
{
|
|
|
|
|
var request = new HttpRequestBuilder(RenewUri)
|
|
|
|
|
.AddQueryParam("refresh_token", refreshToken)
|
|
|
|
|
.WithRateLimit(2)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
return _httpClient.Get<TraktAuthRefreshResource>(request)?.Resource ?? null;
|
|
|
|
@ -83,9 +85,11 @@ namespace NzbDrone.Core.Notifications.Trakt
|
|
|
|
|
private HttpRequest BuildRequest(string resource, HttpMethod method, string accessToken)
|
|
|
|
|
{
|
|
|
|
|
var request = new HttpRequestBuilder(URL).Resource(resource).Build();
|
|
|
|
|
request.Method = method;
|
|
|
|
|
|
|
|
|
|
request.RateLimit = TimeSpan.FromSeconds(2);
|
|
|
|
|
request.Headers.Accept = HttpAccept.Json.Value;
|
|
|
|
|
request.Method = method;
|
|
|
|
|
|
|
|
|
|
request.Headers.Add("trakt-api-version", "2");
|
|
|
|
|
request.Headers.Add("trakt-api-key", ClientId);
|
|
|
|
|
|
|
|
|
|