mirror of
https://github.com/Radarr/Radarr
synced 2026-05-07 10:10:59 +02:00
Merge 3af626a856 into 9226876792
This commit is contained in:
commit
f8cf6d083d
1 changed files with 19 additions and 23 deletions
|
|
@ -126,33 +126,19 @@ public override IEnumerable<DownloadClientItem> GetItems()
|
|||
|
||||
return queueItems;
|
||||
}
|
||||
|
||||
protected override string AddFromMagnetLink(RemoteMovie remoteMovie, string hash, string magnetLink)
|
||||
{
|
||||
return _proxy.AddTaskFromUrl(magnetLink,
|
||||
GetDownloadDirectory().EncodeBase64(),
|
||||
ToBePaused(),
|
||||
ToBeQueuedFirst(remoteMovie),
|
||||
GetSeedRatio(remoteMovie),
|
||||
Settings);
|
||||
return _proxy.AddTaskFromUrl(magnetLink, GetDownloadDirectory(remoteMovie).EncodeBase64(), ToBePaused(), ToBeQueuedFirst(remoteMovie), GetSeedRatio(remoteMovie), Settings);
|
||||
}
|
||||
|
||||
protected override string AddFromTorrentFile(RemoteMovie remoteMovie, string hash, string filename, byte[] fileContent)
|
||||
{
|
||||
return _proxy.AddTaskFromFile(filename,
|
||||
fileContent,
|
||||
GetDownloadDirectory().EncodeBase64(),
|
||||
ToBePaused(),
|
||||
ToBeQueuedFirst(remoteMovie),
|
||||
GetSeedRatio(remoteMovie),
|
||||
Settings);
|
||||
return _proxy.AddTaskFromFile(filename, fileContent, GetDownloadDirectory(remoteMovie).EncodeBase64(), ToBePaused(), ToBeQueuedFirst(remoteMovie), GetSeedRatio(remoteMovie), Settings);
|
||||
}
|
||||
|
||||
|
||||
public override void RemoveItem(DownloadClientItem item, bool deleteData)
|
||||
{
|
||||
_proxy.DeleteTask(item.DownloadId, deleteData, Settings);
|
||||
}
|
||||
|
||||
public override DownloadClientInfo GetStatus()
|
||||
{
|
||||
var destDir = GetDownloadDirectory();
|
||||
|
|
@ -186,22 +172,32 @@ protected override void Test(List<ValidationFailure> failures)
|
|||
}
|
||||
}
|
||||
|
||||
private string GetDownloadDirectory()
|
||||
private string GetDownloadDirectory(RemoteMovie remoteMovie = null)
|
||||
{
|
||||
string destDir;
|
||||
|
||||
if (Settings.DestinationDirectory.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
return Settings.DestinationDirectory.TrimEnd('/');
|
||||
destDir = Settings.DestinationDirectory.TrimEnd('/');
|
||||
}
|
||||
else
|
||||
{
|
||||
destDir = _proxy.GetDownloadConfiguration(Settings).DecodedDownloadDirectory.TrimEnd('/');
|
||||
}
|
||||
|
||||
var destDir = _proxy.GetDownloadConfiguration(Settings).DecodedDownloadDirectory.TrimEnd('/');
|
||||
|
||||
if (Settings.Category.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
destDir = $"{destDir}/{Settings.Category}";
|
||||
}
|
||||
|
||||
return destDir;
|
||||
}
|
||||
if (remoteMovie?.Release?.Title.IsNotNullOrWhiteSpace() ?? false)
|
||||
{
|
||||
var folderName = FileNameExtensions.CleanFileName(remoteMovie.Release.Title);
|
||||
destDir = $"{destDir}/{folderName}";
|
||||
}
|
||||
|
||||
return destDir;
|
||||
}
|
||||
|
||||
private bool ToBePaused()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue