mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-23 22:45:06 -04:00
Fixed: (Cardigann) Magnet generation for public indexers with InfoHash
Fixes #668
This commit is contained in:
@@ -132,10 +132,25 @@ namespace NzbDrone.Core.Indexers
|
||||
c.DownloadProtocol = Protocol;
|
||||
c.IndexerPriority = ((IndexerDefinition)Definition).Priority;
|
||||
|
||||
//Add common flags
|
||||
if (Protocol == DownloadProtocol.Torrent && ((TorrentInfo)c).DownloadVolumeFactor == 0)
|
||||
if (Protocol == DownloadProtocol.Torrent)
|
||||
{
|
||||
c.IndexerFlags.Add(IndexerFlag.FreeLeech);
|
||||
// generate magnet link from info hash (not allowed for private sites)
|
||||
if (((TorrentInfo)c).MagnetUrl == null && !string.IsNullOrWhiteSpace(((TorrentInfo)c).InfoHash) && ((IndexerDefinition)Definition).Privacy != IndexerPrivacy.Private)
|
||||
{
|
||||
((TorrentInfo)c).MagnetUrl = MagnetLinkBuilder.BuildPublicMagnetLink(((TorrentInfo)c).InfoHash, c.Title);
|
||||
}
|
||||
|
||||
// generate info hash from magnet link
|
||||
if (((TorrentInfo)c).MagnetUrl != null && string.IsNullOrWhiteSpace(((TorrentInfo)c).InfoHash))
|
||||
{
|
||||
((TorrentInfo)c).InfoHash = MagnetLinkBuilder.GetInfoHashFromMagnet(((TorrentInfo)c).MagnetUrl);
|
||||
}
|
||||
|
||||
//Add common flags
|
||||
if (((TorrentInfo)c).DownloadVolumeFactor == 0)
|
||||
{
|
||||
((TorrentInfo)c).IndexerFlags.Add(IndexerFlag.FreeLeech);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user