mirror of
https://github.com/Prowlarr/Prowlarr
synced 2026-01-13 03:02:04 +01:00
Build Magnet on Cardigann separate
This commit is contained in:
parent
6d62744667
commit
ea83020714
2 changed files with 15 additions and 12 deletions
|
|
@ -358,6 +358,21 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
|
|||
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");
|
||||
|
||||
return releases;
|
||||
|
|
|
|||
|
|
@ -134,18 +134,6 @@ protected virtual IList<ReleaseInfo> CleanupReleases(IEnumerable<ReleaseInfo> re
|
|||
|
||||
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
|
||||
if (((TorrentInfo)c).DownloadVolumeFactor == 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue