mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-04-24 05:47:22 -04:00
Move scene flag to TorrentInfo and return tag in response
This commit is contained in:
parent
09606af351
commit
07b98f4137
12 changed files with 29 additions and 30 deletions
|
@ -9,8 +9,8 @@ using NUnit.Framework;
|
|||
using NzbDrone.Common.Http;
|
||||
using NzbDrone.Core.Indexers;
|
||||
using NzbDrone.Core.Indexers.Definitions;
|
||||
using NzbDrone.Core.Indexers.Definitions.Gazelle;
|
||||
using NzbDrone.Core.IndexerSearch.Definitions;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Test.IndexerTests.OrpheusTests
|
||||
|
@ -40,9 +40,9 @@ namespace NzbDrone.Core.Test.IndexerTests.OrpheusTests
|
|||
var releases = (await Subject.Fetch(new BasicSearchCriteria { Categories = new[] { 3000 } })).Releases;
|
||||
|
||||
releases.Should().HaveCount(65);
|
||||
releases.First().Should().BeOfType<GazelleInfo>();
|
||||
releases.First().Should().BeOfType<TorrentInfo>();
|
||||
|
||||
var torrentInfo = releases.First() as GazelleInfo;
|
||||
var torrentInfo = releases.First() as TorrentInfo;
|
||||
|
||||
torrentInfo.Title.Should().Be("The Beatles - Abbey Road [1969] [Album] [2.0 Mix 2019] [MP3 V2 (VBR)] [BD]");
|
||||
torrentInfo.DownloadProtocol.Should().Be(DownloadProtocol.Torrent);
|
||||
|
|
|
@ -9,8 +9,8 @@ using NUnit.Framework;
|
|||
using NzbDrone.Common.Http;
|
||||
using NzbDrone.Core.Indexers;
|
||||
using NzbDrone.Core.Indexers.Definitions;
|
||||
using NzbDrone.Core.Indexers.Definitions.Gazelle;
|
||||
using NzbDrone.Core.IndexerSearch.Definitions;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Test.IndexerTests.RedactedTests
|
||||
|
@ -40,9 +40,9 @@ namespace NzbDrone.Core.Test.IndexerTests.RedactedTests
|
|||
var releases = (await Subject.Fetch(new BasicSearchCriteria { Categories = new[] { 3000 } })).Releases;
|
||||
|
||||
releases.Should().HaveCount(39);
|
||||
releases.First().Should().BeOfType<GazelleInfo>();
|
||||
releases.First().Should().BeOfType<TorrentInfo>();
|
||||
|
||||
var torrentInfo = releases.First() as GazelleInfo;
|
||||
var torrentInfo = releases.First() as TorrentInfo;
|
||||
|
||||
torrentInfo.Title.Should().Be("Red Hot Chili Peppers - Californication [1999] [Album] [US / Reissue 2020] [FLAC 24bit Lossless] [Vinyl]");
|
||||
torrentInfo.DownloadProtocol.Should().Be(DownloadProtocol.Torrent);
|
||||
|
|
|
@ -11,6 +11,7 @@ using NzbDrone.Core.Indexers;
|
|||
using NzbDrone.Core.Indexers.Definitions;
|
||||
using NzbDrone.Core.Indexers.Definitions.Gazelle;
|
||||
using NzbDrone.Core.IndexerSearch.Definitions;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Test.IndexerTests.SecretCinemaTests
|
||||
|
@ -40,9 +41,9 @@ namespace NzbDrone.Core.Test.IndexerTests.SecretCinemaTests
|
|||
var releases = (await Subject.Fetch(new BasicSearchCriteria { Categories = new[] { 2000 } })).Releases;
|
||||
|
||||
releases.Should().HaveCount(3);
|
||||
releases.First().Should().BeOfType<GazelleInfo>();
|
||||
releases.First().Should().BeOfType<TorrentInfo>();
|
||||
|
||||
var torrentInfo = releases.First() as GazelleInfo;
|
||||
var torrentInfo = releases.First() as TorrentInfo;
|
||||
|
||||
torrentInfo.Title.Should().Be("Singin' in the Rain (1952) 2160p");
|
||||
torrentInfo.DownloadProtocol.Should().Be(DownloadProtocol.Torrent);
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
using NzbDrone.Core.Parser.Model;
|
||||
|
||||
namespace NzbDrone.Core.Indexers.Definitions.Gazelle;
|
||||
|
||||
public class GazelleInfo : TorrentInfo
|
||||
{
|
||||
public bool? Scene { get; set; }
|
||||
}
|
|
@ -69,7 +69,7 @@ public class GazelleParser : IParseIndexerResponse
|
|||
|
||||
var infoUrl = GetInfoUrl(result.GroupId, id);
|
||||
|
||||
var release = new GazelleInfo
|
||||
var release = new TorrentInfo
|
||||
{
|
||||
Guid = infoUrl,
|
||||
Title = WebUtility.HtmlDecode(title),
|
||||
|
@ -108,7 +108,7 @@ public class GazelleParser : IParseIndexerResponse
|
|||
var groupName = WebUtility.HtmlDecode(result.GroupName);
|
||||
var infoUrl = GetInfoUrl(result.GroupId, id);
|
||||
|
||||
var release = new GazelleInfo
|
||||
var release = new TorrentInfo
|
||||
{
|
||||
Guid = infoUrl,
|
||||
Title = groupName,
|
||||
|
|
|
@ -171,7 +171,7 @@ public class GreatPosterWallParser : GazelleParser
|
|||
var infoUrl = GetInfoUrl(result.GroupId.ToString(), torrent.TorrentId);
|
||||
var time = DateTime.SpecifyKind(torrent.Time, DateTimeKind.Unspecified);
|
||||
|
||||
var release = new GazelleInfo
|
||||
var release = new TorrentInfo
|
||||
{
|
||||
Title = WebUtility.HtmlDecode(torrent.FileName).Trim(),
|
||||
Guid = infoUrl,
|
||||
|
|
|
@ -265,7 +265,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||
var title = GetTitle(result, torrent);
|
||||
var infoUrl = GetInfoUrl(result.GroupId, id);
|
||||
|
||||
var release = new GazelleInfo
|
||||
var release = new TorrentInfo
|
||||
{
|
||||
Guid = infoUrl,
|
||||
InfoUrl = infoUrl,
|
||||
|
@ -306,7 +306,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||
var id = result.TorrentId;
|
||||
var infoUrl = GetInfoUrl(result.GroupId, id);
|
||||
|
||||
var release = new GazelleInfo
|
||||
var release = new TorrentInfo
|
||||
{
|
||||
Guid = infoUrl,
|
||||
Title = WebUtility.HtmlDecode(result.GroupName),
|
||||
|
|
|
@ -231,7 +231,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||
var title = GetTitle(result, torrent);
|
||||
var infoUrl = GetInfoUrl(result.GroupId, id);
|
||||
|
||||
var release = new GazelleInfo
|
||||
var release = new TorrentInfo
|
||||
{
|
||||
Guid = infoUrl,
|
||||
InfoUrl = infoUrl,
|
||||
|
@ -272,7 +272,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||
var id = result.TorrentId;
|
||||
var infoUrl = GetInfoUrl(result.GroupId, id);
|
||||
|
||||
var release = new GazelleInfo
|
||||
var release = new TorrentInfo
|
||||
{
|
||||
Guid = infoUrl,
|
||||
Title = WebUtility.HtmlDecode(result.GroupName),
|
||||
|
|
|
@ -110,7 +110,7 @@ public class SecretCinemaParser : IParseIndexerResponse
|
|||
var title = WebUtility.HtmlDecode(result.GroupName);
|
||||
var time = DateTime.SpecifyKind(torrent.Time, DateTimeKind.Unspecified);
|
||||
|
||||
var release = new GazelleInfo
|
||||
var release = new TorrentInfo
|
||||
{
|
||||
Guid = $"SecretCinema-{id}",
|
||||
Title = title,
|
||||
|
@ -170,7 +170,7 @@ public class SecretCinemaParser : IParseIndexerResponse
|
|||
var id = result.TorrentId;
|
||||
var groupName = WebUtility.HtmlDecode(result.GroupName);
|
||||
|
||||
var release = new GazelleInfo
|
||||
var release = new TorrentInfo
|
||||
{
|
||||
Guid = $"SecretCinema-{id}",
|
||||
Title = groupName,
|
||||
|
|
|
@ -339,7 +339,7 @@ public class ShazbatParser : IParseIndexerResponse
|
|||
Seeders = seeders,
|
||||
Peers = seeders + leechers,
|
||||
PublishDate = publishDate,
|
||||
IndexerFlags = new HashSet<IndexerFlag> { IndexerFlag.Scene },
|
||||
Scene = true,
|
||||
Genres = row.QuerySelectorAll("label.label-tag").Select(t => t.TextContent.Trim()).ToList(),
|
||||
DownloadVolumeFactor = hasGlobalFreeleech ? 0 : 1,
|
||||
UploadVolumeFactor = 1,
|
||||
|
|
|
@ -131,12 +131,17 @@ namespace NzbDrone.Core.Indexers
|
|||
c.IndexerPrivacy = ((IndexerDefinition)Definition).Privacy;
|
||||
c.IndexerPriority = ((IndexerDefinition)Definition).Priority;
|
||||
|
||||
if (Protocol == DownloadProtocol.Torrent)
|
||||
//Add common flags
|
||||
if (Protocol == DownloadProtocol.Torrent && c is TorrentInfo torrentRelease)
|
||||
{
|
||||
//Add common flags
|
||||
if (((TorrentInfo)c).DownloadVolumeFactor == 0)
|
||||
if (torrentRelease.DownloadVolumeFactor == 0)
|
||||
{
|
||||
((TorrentInfo)c).IndexerFlags.Add(IndexerFlag.FreeLeech);
|
||||
torrentRelease.IndexerFlags.Add(IndexerFlag.FreeLeech);
|
||||
}
|
||||
|
||||
if (torrentRelease.Scene.GetValueOrDefault(false))
|
||||
{
|
||||
torrentRelease.IndexerFlags.Add(IndexerFlag.Scene);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace NzbDrone.Core.Parser.Model
|
|||
public long? MinimumSeedTime { get; set; }
|
||||
public double? DownloadVolumeFactor { get; set; }
|
||||
public double? UploadVolumeFactor { get; set; }
|
||||
public bool? Scene { get; set; }
|
||||
|
||||
public TorrentSeedConfiguration SeedConfiguration { get; set; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue