New: Handle Freeleech flag at IndexerBase

This sets freeleech flag automatically for torrent releases with DownloadVolumeFactor = 0
pull/249/head
Qstick 3 years ago
parent 97b09335df
commit 61c1e934a5

@ -40,11 +40,6 @@ namespace NzbDrone.Core.Indexers.FileList
var flags = new List<IndexerFlag>();
if (result.FreeLeech)
{
flags.Add(IndexerFlag.FreeLeech);
}
var imdbId = 0;
if (result.ImdbId != null && result.ImdbId.Length > 2)
{

@ -57,11 +57,6 @@ namespace NzbDrone.Core.Indexers.HDBits
var flags = new List<IndexerFlag>();
if (result.FreeLeech == "yes")
{
flags.Add(IndexerFlag.FreeLeech);
}
if (internalRelease)
{
flags.Add(IndexerFlag.Internal);
@ -83,6 +78,8 @@ namespace NzbDrone.Core.Indexers.HDBits
Internal = internalRelease,
ImdbId = result.ImdbInfo?.Id ?? 0,
TvdbId = result.TvdbInfo?.Id ?? 0,
DownloadVolumeFactor = result.FreeLeech == "yes" ? 0 : 1,
UploadVolumeFactor = 1,
IndexerFlags = flags
});
}

@ -78,11 +78,6 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
flags.Add(PassThePopcornFlag.Approved); //title = $"{title} ✔";
}
if (torrent.FreeleechType == "Freeleech")
{
flags.Add(IndexerFlag.FreeLeech);
}
if (torrent.Scene)
{
flags.Add(IndexerFlag.Scene);

@ -91,6 +91,12 @@ namespace NzbDrone.Core.Indexers
c.Indexer = Definition.Name;
c.DownloadProtocol = Protocol;
c.IndexerPriority = ((IndexerDefinition)Definition).Priority;
//Add common flags
if (Protocol == DownloadProtocol.Torrent && ((TorrentInfo)c).DownloadVolumeFactor == 0)
{
c.IndexerFlags.Add(IndexerFlag.FreeLeech);
}
});
return result;

Loading…
Cancel
Save