mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-12-27 08:44:34 +01:00
New: Force all usenet indexers to use Redirection
This commit is contained in:
@@ -208,6 +208,12 @@ namespace NzbDrone.Core.Indexers
|
||||
|
||||
try
|
||||
{
|
||||
// Ensure Redirect is true for Usenet protocols
|
||||
if (Protocol == DownloadProtocol.Usenet || (SupportsRedirect && Redirect))
|
||||
{
|
||||
failures.Add(new ValidationFailure("Redirect", "Redirect must be enabled for Usenet indexers"));
|
||||
}
|
||||
|
||||
Test(failures).GetAwaiter().GetResult();
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -262,8 +262,8 @@ namespace NzbDrone.Api.V1.Indexers
|
||||
throw new BadRequestException("Failed to normalize provided link");
|
||||
}
|
||||
|
||||
// If Indexer is set to download via Redirect then just redirect to the link
|
||||
if (indexer.SupportsRedirect && indexerDef.Redirect)
|
||||
// If Indexer is set to download via Redirect then just redirect to the link unless it's a Usenet indexer at which point it forces Redirect.
|
||||
if (indexer.Protocol == DownloadProtocol.Usenet || (indexer.SupportsRedirect && indexerDef.Redirect))
|
||||
{
|
||||
_downloadService.RecordRedirect(unprotectedLink, id, source, host, file);
|
||||
return RedirectPermanent(unprotectedLink);
|
||||
|
||||
Reference in New Issue
Block a user