mirror of
https://github.com/Prowlarr/Prowlarr
synced 2025-12-06 08:34:28 +01:00
New: Force all usenet indexers to use Redirection
This commit is contained in:
parent
cbfec3df3c
commit
aba69901c9
2 changed files with 8 additions and 2 deletions
|
|
@ -208,6 +208,12 @@ public ValidationResult Test()
|
|||
|
||||
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 @@ public async Task<object> GetDownload(int id, string link, string file)
|
|||
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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue