mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-12 11:15:43 +02:00
parent
0ea189d03c
commit
07cbd7c8d2
@ -310,20 +310,16 @@ protected ValidationFailure TestOutputPath()
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var downloadDir = GetDefaultDir();
|
var downloadDir = GetDownloadDirectory();
|
||||||
|
|
||||||
if (downloadDir == null)
|
if (downloadDir == null)
|
||||||
{
|
{
|
||||||
return new NzbDroneValidationFailure(nameof(Settings.TvDirectory), "DownloadClientDownloadStationValidationNoDefaultDestination")
|
return new NzbDroneValidationFailure(nameof(Settings.TvDirectory), _localizationService.GetLocalizedString("DownloadClientDownloadStationValidationNoDefaultDestination"))
|
||||||
{
|
{
|
||||||
DetailedDescription = _localizationService.GetLocalizedString("DownloadClientDownloadStationValidationNoDefaultDestinationDetail", new Dictionary<string, object> { { "username", Settings.Username } })
|
DetailedDescription = _localizationService.GetLocalizedString("DownloadClientDownloadStationValidationNoDefaultDestinationDetail", new Dictionary<string, object> { { "username", Settings.Username } })
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
downloadDir = GetDownloadDirectory();
|
|
||||||
|
|
||||||
if (downloadDir != null)
|
|
||||||
{
|
|
||||||
var sharedFolder = downloadDir.Split('\\', '/')[0];
|
var sharedFolder = downloadDir.Split('\\', '/')[0];
|
||||||
var fieldName = Settings.TvDirectory.IsNotNullOrWhiteSpace() ? nameof(Settings.TvDirectory) : nameof(Settings.TvCategory);
|
var fieldName = Settings.TvDirectory.IsNotNullOrWhiteSpace() ? nameof(Settings.TvDirectory) : nameof(Settings.TvCategory);
|
||||||
|
|
||||||
@ -344,7 +340,6 @@ protected ValidationFailure TestOutputPath()
|
|||||||
DetailedDescription = _localizationService.GetLocalizedString("DownloadClientDownloadStationValidationFolderMissingDetail", new Dictionary<string, object> { { "downloadDir", downloadDir }, { "sharedFolder", sharedFolder } })
|
DetailedDescription = _localizationService.GetLocalizedString("DownloadClientDownloadStationValidationFolderMissingDetail", new Dictionary<string, object> { { "downloadDir", downloadDir }, { "sharedFolder", sharedFolder } })
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -460,7 +455,7 @@ protected string GetDownloadDirectory()
|
|||||||
|
|
||||||
var destDir = GetDefaultDir();
|
var destDir = GetDefaultDir();
|
||||||
|
|
||||||
if (Settings.TvCategory.IsNotNullOrWhiteSpace())
|
if (destDir.IsNotNullOrWhiteSpace() && Settings.TvCategory.IsNotNullOrWhiteSpace())
|
||||||
{
|
{
|
||||||
return $"{destDir.TrimEnd('/')}/{Settings.TvCategory}";
|
return $"{destDir.TrimEnd('/')}/{Settings.TvCategory}";
|
||||||
}
|
}
|
||||||
|
@ -211,20 +211,16 @@ protected ValidationFailure TestOutputPath()
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var downloadDir = GetDefaultDir();
|
var downloadDir = GetDownloadDirectory();
|
||||||
|
|
||||||
if (downloadDir == null)
|
if (downloadDir == null)
|
||||||
{
|
{
|
||||||
return new NzbDroneValidationFailure(nameof(Settings.TvDirectory), "DownloadClientDownloadStationValidationNoDefaultDestination")
|
return new NzbDroneValidationFailure(nameof(Settings.TvDirectory), _localizationService.GetLocalizedString("DownloadClientDownloadStationValidationNoDefaultDestination"))
|
||||||
{
|
{
|
||||||
DetailedDescription = _localizationService.GetLocalizedString("DownloadClientDownloadStationValidationNoDefaultDestinationDetail", new Dictionary<string, object> { { "username", Settings.Username } })
|
DetailedDescription = _localizationService.GetLocalizedString("DownloadClientDownloadStationValidationNoDefaultDestinationDetail", new Dictionary<string, object> { { "username", Settings.Username } })
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
downloadDir = GetDownloadDirectory();
|
|
||||||
|
|
||||||
if (downloadDir != null)
|
|
||||||
{
|
|
||||||
var sharedFolder = downloadDir.Split('\\', '/')[0];
|
var sharedFolder = downloadDir.Split('\\', '/')[0];
|
||||||
var fieldName = Settings.TvDirectory.IsNotNullOrWhiteSpace() ? nameof(Settings.TvDirectory) : nameof(Settings.TvCategory);
|
var fieldName = Settings.TvDirectory.IsNotNullOrWhiteSpace() ? nameof(Settings.TvDirectory) : nameof(Settings.TvCategory);
|
||||||
|
|
||||||
@ -234,7 +230,8 @@ protected ValidationFailure TestOutputPath()
|
|||||||
{
|
{
|
||||||
return new NzbDroneValidationFailure(fieldName, _localizationService.GetLocalizedString("DownloadClientDownloadStationValidationSharedFolderMissing"))
|
return new NzbDroneValidationFailure(fieldName, _localizationService.GetLocalizedString("DownloadClientDownloadStationValidationSharedFolderMissing"))
|
||||||
{
|
{
|
||||||
DetailedDescription = _localizationService.GetLocalizedString("DownloadClientDownloadStationValidationSharedFolderMissingDetail", new Dictionary<string, object> { { "sharedFolder", sharedFolder } })
|
DetailedDescription = _localizationService.GetLocalizedString("DownloadClientDownloadStationValidationSharedFolderMissingDetail",
|
||||||
|
new Dictionary<string, object> { { "sharedFolder", sharedFolder } })
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,7 +242,6 @@ protected ValidationFailure TestOutputPath()
|
|||||||
DetailedDescription = _localizationService.GetLocalizedString("DownloadClientDownloadStationValidationFolderMissingDetail", new Dictionary<string, object> { { "downloadDir", downloadDir }, { "sharedFolder", sharedFolder } })
|
DetailedDescription = _localizationService.GetLocalizedString("DownloadClientDownloadStationValidationFolderMissingDetail", new Dictionary<string, object> { { "downloadDir", downloadDir }, { "sharedFolder", sharedFolder } })
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -439,7 +435,7 @@ protected string GetDownloadDirectory()
|
|||||||
|
|
||||||
var destDir = GetDefaultDir();
|
var destDir = GetDefaultDir();
|
||||||
|
|
||||||
if (Settings.TvCategory.IsNotNullOrWhiteSpace())
|
if (destDir.IsNotNullOrWhiteSpace() && Settings.TvCategory.IsNotNullOrWhiteSpace())
|
||||||
{
|
{
|
||||||
return $"{destDir.TrimEnd('/')}/{Settings.TvCategory}";
|
return $"{destDir.TrimEnd('/')}/{Settings.TvCategory}";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user