@ -21,7 +21,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
public class TorrentDownloadStation : TorrentClientBase < DownloadStationSettings >
public class TorrentDownloadStation : TorrentClientBase < DownloadStationSettings >
{
{
protected readonly IDownloadStationInfoProxy _dsInfoProxy ;
protected readonly IDownloadStationInfoProxy _dsInfoProxy ;
protected readonly IDownloadStationTaskProxy _dsTaskProxy ;
protected readonly IDownloadStationTaskProxy Selector _dsTaskProxy Selector ;
protected readonly ISharedFolderResolver _sharedFolderResolver ;
protected readonly ISharedFolderResolver _sharedFolderResolver ;
protected readonly ISerialNumberProvider _serialNumberProvider ;
protected readonly ISerialNumberProvider _serialNumberProvider ;
protected readonly IFileStationProxy _fileStationProxy ;
protected readonly IFileStationProxy _fileStationProxy ;
@ -30,7 +30,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
ISerialNumberProvider serialNumberProvider ,
ISerialNumberProvider serialNumberProvider ,
IFileStationProxy fileStationProxy ,
IFileStationProxy fileStationProxy ,
IDownloadStationInfoProxy dsInfoProxy ,
IDownloadStationInfoProxy dsInfoProxy ,
IDownloadStationTaskProxy dsTaskProxy ,
IDownloadStationTaskProxy Selector dsTaskProxy Selector ,
ITorrentFileInfoReader torrentFileInfoReader ,
ITorrentFileInfoReader torrentFileInfoReader ,
IHttpClient httpClient ,
IHttpClient httpClient ,
IConfigService configService ,
IConfigService configService ,
@ -40,7 +40,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
: base ( torrentFileInfoReader , httpClient , configService , diskProvider , remotePathMappingService , logger )
: base ( torrentFileInfoReader , httpClient , configService , diskProvider , remotePathMappingService , logger )
{
{
_dsInfoProxy = dsInfoProxy ;
_dsInfoProxy = dsInfoProxy ;
_dsTaskProxy = dsTaskProxy ;
_dsTaskProxy Selector = dsTaskProxy Selector ;
_fileStationProxy = fileStationProxy ;
_fileStationProxy = fileStationProxy ;
_sharedFolderResolver = sharedFolderResolver ;
_sharedFolderResolver = sharedFolderResolver ;
_serialNumberProvider = serialNumberProvider ;
_serialNumberProvider = serialNumberProvider ;
@ -50,9 +50,11 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
public override ProviderMessage Message = > new ProviderMessage ( "Sonarr is unable to connect to Download Station if 2-Factor Authentication is enabled on your DSM account" , ProviderMessageType . Warning ) ;
public override ProviderMessage Message = > new ProviderMessage ( "Sonarr is unable to connect to Download Station if 2-Factor Authentication is enabled on your DSM account" , ProviderMessageType . Warning ) ;
private IDownloadStationTaskProxy DsTaskProxy = > _dsTaskProxySelector . GetProxy ( Settings ) ;
protected IEnumerable < DownloadStationTask > GetTasks ( )
protected IEnumerable < DownloadStationTask > GetTasks ( )
{
{
return _d sTaskProxy. GetTasks ( Settings ) . Where ( v = > v . Type . ToLower ( ) = = DownloadStationTaskType . BT . ToString ( ) . ToLower ( ) ) ;
return D sTaskProxy. GetTasks ( Settings ) . Where ( v = > v . Type . ToLower ( ) = = DownloadStationTaskType . BT . ToString ( ) . ToLower ( ) ) ;
}
}
public override IEnumerable < DownloadClientItem > GetItems ( )
public override IEnumerable < DownloadClientItem > GetItems ( )
@ -136,7 +138,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
DeleteItemData ( item ) ;
DeleteItemData ( item ) ;
}
}
_d sTaskProxy. RemoveTask ( ParseDownloadId ( item . DownloadId ) , Settings ) ;
D sTaskProxy. RemoveTask ( ParseDownloadId ( item . DownloadId ) , Settings ) ;
_logger . Debug ( "{0} removed correctly" , item . DownloadId ) ;
_logger . Debug ( "{0} removed correctly" , item . DownloadId ) ;
}
}
@ -155,7 +157,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
{
{
var hashedSerialNumber = _serialNumberProvider . GetSerialNumber ( Settings ) ;
var hashedSerialNumber = _serialNumberProvider . GetSerialNumber ( Settings ) ;
_d sTaskProxy. AddTaskFromUrl ( magnetLink , GetDownloadDirectory ( ) , Settings ) ;
D sTaskProxy. AddTaskFromUrl ( magnetLink , GetDownloadDirectory ( ) , Settings ) ;
var item = GetTasks ( ) . SingleOrDefault ( t = > t . Additional . Detail [ "uri" ] = = magnetLink ) ;
var item = GetTasks ( ) . SingleOrDefault ( t = > t . Additional . Detail [ "uri" ] = = magnetLink ) ;
@ -174,7 +176,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
{
{
var hashedSerialNumber = _serialNumberProvider . GetSerialNumber ( Settings ) ;
var hashedSerialNumber = _serialNumberProvider . GetSerialNumber ( Settings ) ;
_d sTaskProxy. AddTaskFromData ( fileContent , filename , GetDownloadDirectory ( ) , Settings ) ;
D sTaskProxy. AddTaskFromData ( fileContent , filename , GetDownloadDirectory ( ) , Settings ) ;
var items = GetTasks ( ) . Where ( t = > t . Additional . Detail [ "uri" ] = = Path . GetFileNameWithoutExtension ( filename ) ) ;
var items = GetTasks ( ) . Where ( t = > t . Additional . Detail [ "uri" ] = = Path . GetFileNameWithoutExtension ( filename ) ) ;
@ -389,7 +391,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
protected ValidationFailure ValidateVersion ( )
protected ValidationFailure ValidateVersion ( )
{
{
var info = _d sTaskProxy. GetApiInfo ( Settings ) ;
var info = D sTaskProxy. GetApiInfo ( Settings ) ;
_logger . Debug ( "Download Station api version information: Min {0} - Max {1}" , info . MinVersion , info . MaxVersion ) ;
_logger . Debug ( "Download Station api version information: Min {0} - Max {1}" , info . MinVersion , info . MaxVersion ) ;