mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-22 22:14:44 -04:00
New: It is now possible to use Completed Download Handling with remote download clients by specifying the local mount in settings.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using FluentValidation.Results;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Common.Disk;
|
||||
using NzbDrone.Core.Indexers;
|
||||
using NzbDrone.Core.Parser;
|
||||
@@ -8,6 +10,7 @@ using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.ThingiProvider;
|
||||
using NzbDrone.Core.Configuration;
|
||||
using NLog;
|
||||
using FluentValidation.Results;
|
||||
|
||||
namespace NzbDrone.Core.Download
|
||||
{
|
||||
@@ -81,6 +84,23 @@ namespace NzbDrone.Core.Download
|
||||
return remoteEpisode;
|
||||
}
|
||||
|
||||
protected void RemapStorage(DownloadClientItem downloadClientItem, String remotePath, String localPath)
|
||||
{
|
||||
if (downloadClientItem.OutputPath.IsNullOrWhiteSpace() || localPath.IsNullOrWhiteSpace())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
remotePath = remotePath.TrimEnd('/', '\\');
|
||||
localPath = localPath.TrimEnd('/', '\\');
|
||||
|
||||
if (downloadClientItem.OutputPath.StartsWith(remotePath))
|
||||
{
|
||||
downloadClientItem.OutputPath = localPath + downloadClientItem.OutputPath.Substring(remotePath.Length);
|
||||
downloadClientItem.OutputPath = downloadClientItem.OutputPath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
|
||||
}
|
||||
}
|
||||
|
||||
protected ValidationFailure TestFolder(String folder, String propertyName, Boolean mustBeWritable = true)
|
||||
{
|
||||
if (!_diskProvider.FolderExists(folder))
|
||||
|
||||
Reference in New Issue
Block a user