@ -31,25 +31,17 @@ namespace NzbDrone.Core.Download.Clients.Deluge
_proxy = proxy ;
}
protected override string AddFromMagnetLink ( RemoteMovie remote Episod e, string hash , string magnetLink )
protected override string AddFromMagnetLink ( RemoteMovie remote Movi e, string hash , string magnetLink )
{
var actualHash = _proxy . AddTorrentFromMagnet ( magnetLink , Settings ) ;
if ( ! Settings . Tv Category. IsNullOrWhiteSpace ( ) )
if ( ! Settings . Movie Category. IsNullOrWhiteSpace ( ) )
{
_proxy . SetLabel ( actualHash , Settings . Tv Category, Settings ) ;
_proxy . SetLabel ( actualHash , Settings . Movie Category, Settings ) ;
}
_proxy . SetTorrentConfiguration ( actualHash , "remove_at_ratio" , false , Settings ) ;
/ * var isRecentEpisode = remoteEpisode . IsRecentEpisode ( ) ;
if ( isRecentEpisode & & Settings . RecentTvPriority = = ( int ) DelugePriority . First | |
! isRecentEpisode & & Settings . OlderTvPriority = = ( int ) DelugePriority . First )
{
_proxy . MoveTorrentToTopInQueue ( actualHash , Settings ) ;
} * /
return actualHash . ToUpper ( ) ;
}
@ -57,66 +49,24 @@ namespace NzbDrone.Core.Download.Clients.Deluge
{
var actualHash = _proxy . AddTorrentFromFile ( filename , fileContent , Settings ) ;
if ( ! Settings . Tv Category. IsNullOrWhiteSpace ( ) )
if ( ! Settings . Movie Category. IsNullOrWhiteSpace ( ) )
{
_proxy . SetLabel ( actualHash , Settings . Tv Category, Settings ) ;
_proxy . SetLabel ( actualHash , Settings . Movie Category, Settings ) ;
}
_proxy . SetTorrentConfiguration ( actualHash , "remove_at_ratio" , false , Settings ) ;
/ * var isRecentEpisode = remoteEpisode . IsRecentEpisode ( ) ;
if ( isRecentEpisode & & Settings . RecentTvPriority = = ( int ) DelugePriority . First | |
! isRecentEpisode & & Settings . OlderTvPriority = = ( int ) DelugePriority . First )
{
_proxy . MoveTorrentToTopInQueue ( actualHash , Settings ) ;
} * /
return actualHash . ToUpper ( ) ;
}
protected override string AddFromMagnetLink ( RemoteEpisode remoteEpisode , string hash , string magnetLink )
{
var actualHash = _proxy . AddTorrentFromMagnet ( magnetLink , Settings ) ;
if ( ! Settings . TvCategory . IsNullOrWhiteSpace ( ) )
{
_proxy . SetLabel ( actualHash , Settings . TvCategory , Settings ) ;
}
_proxy . SetTorrentConfiguration ( actualHash , "remove_at_ratio" , false , Settings ) ;
var isRecentEpisode = remoteEpisode . IsRecentEpisode ( ) ;
if ( isRecentEpisode & & Settings . RecentTvPriority = = ( int ) DelugePriority . First | |
! isRecentEpisode & & Settings . OlderTvPriority = = ( int ) DelugePriority . First )
{
_proxy . MoveTorrentToTopInQueue ( actualHash , Settings ) ;
}
return actualHash . ToUpper ( ) ;
throw new NotImplementedException ( "Episodes are not working with Radarr" ) ;
}
protected override string AddFromTorrentFile ( RemoteEpisode remoteEpisode , string hash , string filename , byte [ ] fileContent )
{
var actualHash = _proxy . AddTorrentFromFile ( filename , fileContent , Settings ) ;
if ( ! Settings . TvCategory . IsNullOrWhiteSpace ( ) )
{
_proxy . SetLabel ( actualHash , Settings . TvCategory , Settings ) ;
}
_proxy . SetTorrentConfiguration ( actualHash , "remove_at_ratio" , false , Settings ) ;
var isRecentEpisode = remoteEpisode . IsRecentEpisode ( ) ;
if ( isRecentEpisode & & Settings . RecentTvPriority = = ( int ) DelugePriority . First | |
! isRecentEpisode & & Settings . OlderTvPriority = = ( int ) DelugePriority . First )
{
_proxy . MoveTorrentToTopInQueue ( actualHash , Settings ) ;
}
return actualHash . ToUpper ( ) ;
throw new NotImplementedException ( "Episodes are not working with Radarr" ) ;
}
public override string Name = > "Deluge" ;
@ -127,9 +77,9 @@ namespace NzbDrone.Core.Download.Clients.Deluge
try
{
if ( ! Settings . Tv Category. IsNullOrWhiteSpace ( ) )
if ( ! Settings . Movie Category. IsNullOrWhiteSpace ( ) )
{
torrents = _proxy . GetTorrentsByLabel ( Settings . Tv Category, Settings ) ;
torrents = _proxy . GetTorrentsByLabel ( Settings . Movie Category, Settings ) ;
}
else
{
@ -149,7 +99,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge
var item = new DownloadClientItem ( ) ;
item . DownloadId = torrent . Hash . ToUpper ( ) ;
item . Title = torrent . Name ;
item . Category = Settings . Tv Category;
item . Category = Settings . Movie Category;
item . DownloadClient = Definition . Name ;
@ -280,7 +230,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge
private ValidationFailure TestCategory ( )
{
if ( Settings . Tv Category. IsNullOrWhiteSpace ( ) )
if ( Settings . Movie Category. IsNullOrWhiteSpace ( ) )
{
return null ;
}
@ -297,14 +247,14 @@ namespace NzbDrone.Core.Download.Clients.Deluge
var labels = _proxy . GetAvailableLabels ( Settings ) ;
if ( ! labels . Contains ( Settings . Tv Category) )
if ( ! labels . Contains ( Settings . Movie Category) )
{
_proxy . AddLabel ( Settings . Tv Category, Settings ) ;
_proxy . AddLabel ( Settings . Movie Category, Settings ) ;
labels = _proxy . GetAvailableLabels ( Settings ) ;
if ( ! labels . Contains ( Settings . Tv Category) )
if ( ! labels . Contains ( Settings . Movie Category) )
{
return new NzbDroneValidationFailure ( " Tv Category", "Configuration of label failed" )
return new NzbDroneValidationFailure ( " Movie Category", "Configuration of label failed" )
{
DetailedDescription = "Radarr as unable to add the label to Deluge."
} ;