mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Build Magnet on Cardigann separate
This commit is contained in:
@@ -358,6 +358,21 @@ namespace NzbDrone.Core.Indexers.Cardigann
|
|||||||
releases = releases.Take(query.Limit).ToList();
|
releases = releases.Take(query.Limit).ToList();
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
releases.ForEach(c =>
|
||||||
|
{
|
||||||
|
// generate magnet link from info hash (not allowed for private sites)
|
||||||
|
if (((TorrentInfo)c).MagnetUrl == null && !string.IsNullOrWhiteSpace(((TorrentInfo)c).InfoHash) && _definition.Type != "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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
_logger.Debug($"Got {releases.Count} releases");
|
_logger.Debug($"Got {releases.Count} releases");
|
||||||
|
|
||||||
return releases;
|
return releases;
|
||||||
|
@@ -134,18 +134,6 @@ namespace NzbDrone.Core.Indexers
|
|||||||
|
|
||||||
if (Protocol == DownloadProtocol.Torrent)
|
if (Protocol == DownloadProtocol.Torrent)
|
||||||
{
|
{
|
||||||
// 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
|
//Add common flags
|
||||||
if (((TorrentInfo)c).DownloadVolumeFactor == 0)
|
if (((TorrentInfo)c).DownloadVolumeFactor == 0)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user