2014-07-20 11:36:31 +00:00
|
|
|
|
using System;
|
|
|
|
|
using RestSharp;
|
|
|
|
|
using NzbDrone.Common.EnvironmentInfo;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Rest
|
|
|
|
|
{
|
|
|
|
|
public static class RestClientFactory
|
|
|
|
|
{
|
|
|
|
|
public static RestClient BuildClient(String baseUrl)
|
|
|
|
|
{
|
|
|
|
|
var restClient = new RestClient(baseUrl);
|
|
|
|
|
|
2014-11-25 15:28:49 +00:00
|
|
|
|
restClient.UserAgent = String.Format("Sonarr/{0} (RestSharp/{1}; {2}/{3})",
|
2014-07-20 11:36:31 +00:00
|
|
|
|
BuildInfo.Version,
|
|
|
|
|
restClient.GetType().Assembly.GetName().Version,
|
|
|
|
|
OsInfo.Os, OsInfo.Version.ToString(2));
|
|
|
|
|
|
|
|
|
|
return restClient;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|