Added ContentSummary to be able to describe the ContentData in a human readable form. (Useful for JsonRpc and FormData).pull/1166/head
parent
7818f0c59b
commit
2ffbbb0e71
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using NzbDrone.Common.Http;
|
||||
|
||||
namespace NzbDrone.Common.Cloud
|
||||
{
|
||||
public interface ISonarrCloudRequestBuilder
|
||||
{
|
||||
IHttpRequestBuilderFactory Services { get; }
|
||||
IHttpRequestBuilderFactory SkyHookTvdb { get; }
|
||||
}
|
||||
|
||||
public class SonarrCloudRequestBuilder : ISonarrCloudRequestBuilder
|
||||
{
|
||||
public SonarrCloudRequestBuilder()
|
||||
{
|
||||
Services = new HttpRequestBuilder("http://services.sonarr.tv/v1/")
|
||||
.CreateFactory();
|
||||
|
||||
SkyHookTvdb = new HttpRequestBuilder("http://skyhook.sonarr.tv/v1/tvdb/{route}/{language}/")
|
||||
.SetSegment("language", "en")
|
||||
.CreateFactory();
|
||||
}
|
||||
|
||||
public IHttpRequestBuilderFactory Services { get; private set; }
|
||||
|
||||
public IHttpRequestBuilderFactory SkyHookTvdb { get; private set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace NzbDrone.Common.Http
|
||||
{
|
||||
public class HttpFormData
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string FileName { get; set; }
|
||||
public byte[] ContentData { get; set; }
|
||||
public string ContentType { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace NzbDrone.Common.Http
|
||||
{
|
||||
public interface IHttpRequestBuilderFactory
|
||||
{
|
||||
HttpRequestBuilder Create();
|
||||
}
|
||||
|
||||
public class HttpRequestBuilderFactory : IHttpRequestBuilderFactory
|
||||
{
|
||||
private HttpRequestBuilder _rootBuilder;
|
||||
|
||||
public HttpRequestBuilderFactory(HttpRequestBuilder rootBuilder)
|
||||
{
|
||||
SetRootBuilder(rootBuilder);
|
||||
}
|
||||
|
||||
protected HttpRequestBuilderFactory()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void SetRootBuilder(HttpRequestBuilder rootBuilder)
|
||||
{
|
||||
_rootBuilder = rootBuilder.Clone();
|
||||
}
|
||||
|
||||
public HttpRequestBuilder Create()
|
||||
{
|
||||
return _rootBuilder.Clone();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue