mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
New: Handle Freeleech flag at IndexerBase
This sets freeleech flag automatically for torrent releases with DownloadVolumeFactor = 0
This commit is contained in:
@@ -40,11 +40,6 @@ namespace NzbDrone.Core.Indexers.FileList
|
|||||||
|
|
||||||
var flags = new List<IndexerFlag>();
|
var flags = new List<IndexerFlag>();
|
||||||
|
|
||||||
if (result.FreeLeech)
|
|
||||||
{
|
|
||||||
flags.Add(IndexerFlag.FreeLeech);
|
|
||||||
}
|
|
||||||
|
|
||||||
var imdbId = 0;
|
var imdbId = 0;
|
||||||
if (result.ImdbId != null && result.ImdbId.Length > 2)
|
if (result.ImdbId != null && result.ImdbId.Length > 2)
|
||||||
{
|
{
|
||||||
|
@@ -57,11 +57,6 @@ namespace NzbDrone.Core.Indexers.HDBits
|
|||||||
|
|
||||||
var flags = new List<IndexerFlag>();
|
var flags = new List<IndexerFlag>();
|
||||||
|
|
||||||
if (result.FreeLeech == "yes")
|
|
||||||
{
|
|
||||||
flags.Add(IndexerFlag.FreeLeech);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (internalRelease)
|
if (internalRelease)
|
||||||
{
|
{
|
||||||
flags.Add(IndexerFlag.Internal);
|
flags.Add(IndexerFlag.Internal);
|
||||||
@@ -83,6 +78,8 @@ namespace NzbDrone.Core.Indexers.HDBits
|
|||||||
Internal = internalRelease,
|
Internal = internalRelease,
|
||||||
ImdbId = result.ImdbInfo?.Id ?? 0,
|
ImdbId = result.ImdbInfo?.Id ?? 0,
|
||||||
TvdbId = result.TvdbInfo?.Id ?? 0,
|
TvdbId = result.TvdbInfo?.Id ?? 0,
|
||||||
|
DownloadVolumeFactor = result.FreeLeech == "yes" ? 0 : 1,
|
||||||
|
UploadVolumeFactor = 1,
|
||||||
IndexerFlags = flags
|
IndexerFlags = flags
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -78,11 +78,6 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
|
|||||||
flags.Add(PassThePopcornFlag.Approved); //title = $"{title} ✔";
|
flags.Add(PassThePopcornFlag.Approved); //title = $"{title} ✔";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (torrent.FreeleechType == "Freeleech")
|
|
||||||
{
|
|
||||||
flags.Add(IndexerFlag.FreeLeech);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (torrent.Scene)
|
if (torrent.Scene)
|
||||||
{
|
{
|
||||||
flags.Add(IndexerFlag.Scene);
|
flags.Add(IndexerFlag.Scene);
|
||||||
|
@@ -91,6 +91,12 @@ namespace NzbDrone.Core.Indexers
|
|||||||
c.Indexer = Definition.Name;
|
c.Indexer = Definition.Name;
|
||||||
c.DownloadProtocol = Protocol;
|
c.DownloadProtocol = Protocol;
|
||||||
c.IndexerPriority = ((IndexerDefinition)Definition).Priority;
|
c.IndexerPriority = ((IndexerDefinition)Definition).Priority;
|
||||||
|
|
||||||
|
//Add common flags
|
||||||
|
if (Protocol == DownloadProtocol.Torrent && ((TorrentInfo)c).DownloadVolumeFactor == 0)
|
||||||
|
{
|
||||||
|
c.IndexerFlags.Add(IndexerFlag.FreeLeech);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
Reference in New Issue
Block a user