Moved the update check code from the External azure service into Ombi at /api/v1/update/BRANCH

This commit is contained in:
Jamie 2018-01-10 10:30:55 +00:00
commit 498c019f5d
11 changed files with 516 additions and 9 deletions

View file

@ -1,4 +1,5 @@
using System.Net.Http;
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace Ombi.Api
@ -6,5 +7,6 @@ namespace Ombi.Api
public interface IOmbiHttpClient
{
Task<HttpResponseMessage> SendAsync(HttpRequestMessage request);
Task<string> GetStringAsync(Uri requestUri);
}
}

View file

@ -56,6 +56,18 @@ namespace Ombi.Api
public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request)
{
await Setup();
return await _client.SendAsync(request);
}
public async Task<string> GetStringAsync(Uri requestUri)
{
await Setup();
return await _client.GetStringAsync(requestUri);
}
private async Task Setup()
{
if (_client == null)
{
@ -66,8 +78,6 @@ namespace Ombi.Api
}
_client = new HttpClient(_handler);
}
return await _client.SendAsync(request);
}
private async Task<HttpMessageHandler> GetHandler()