You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
989 B
32 lines
989 B
using NLog;
|
|
using NzbDrone.Common.Cache;
|
|
using NzbDrone.Common.Http;
|
|
using NzbDrone.Core.Download.Clients.DownloadStation.Responses;
|
|
|
|
namespace NzbDrone.Core.Download.Clients.DownloadStation.Proxies
|
|
{
|
|
public interface IDSMInfoProxy
|
|
{
|
|
string GetSerialNumber(DownloadStationSettings settings);
|
|
}
|
|
|
|
public class DSMInfoProxy : DiskStationProxyBase, IDSMInfoProxy
|
|
{
|
|
public DSMInfoProxy(IHttpClient httpClient, ICacheManager cacheManager, Logger logger)
|
|
: base(DiskStationApi.DSMInfo, "SYNO.DSM.Info", httpClient, cacheManager, logger)
|
|
{
|
|
}
|
|
|
|
public string GetSerialNumber(DownloadStationSettings settings)
|
|
{
|
|
var info = GetApiInfo(settings);
|
|
|
|
var requestBuilder = BuildRequest(settings, "getinfo", info.MinVersion);
|
|
|
|
var response = ProcessRequest<DSMInfoResponse>(requestBuilder, "get serial number", settings);
|
|
|
|
return response.Data.SerialNumber;
|
|
}
|
|
}
|
|
}
|