New: Option to prefer magnet URLs over torrent file links

Co-authored-by: Deathspike <meister.deathspike@outlook.com>

New: Bulk edit Prefer Magnet Url for indexers
This commit is contained in:
Bogdan
2024-09-11 14:55:28 +03:00
parent a32ab3acfd
commit 4e8b9e81cf
13 changed files with 97 additions and 6 deletions
@@ -198,7 +198,9 @@ namespace NzbDrone.Api.V1.Indexers
}
}
return CreateResponse(results.ToXml(indexer.Protocol));
var preferMagnetUrl = indexer.Protocol == DownloadProtocol.Torrent && indexerDef.Settings is ITorrentIndexerSettings torrentIndexerSettings && (torrentIndexerSettings.TorrentBaseSettings?.PreferMagnetUrl ?? false);
return CreateResponse(results.ToXml(indexer.Protocol, preferMagnetUrl));
default:
return CreateResponse(CreateErrorXML(202, $"No such function ({requestType})"), statusCode: StatusCodes.Status400BadRequest);
}