mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-22 22:34:53 -04:00
Fixed: EzRSS Size Parsing
This commit is contained in:
@@ -175,6 +175,22 @@ namespace NzbDrone.Core.Test.IndexerTests.IntegrationTests
|
||||
ValidateTorrentResult(result, hasSize: true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void ValidateTorrentResult(IList<ReleaseInfo> reports, bool hasSize = false, bool hasInfoUrl = false, bool hasMagnet = false)
|
||||
{
|
||||
reports.Should().OnlyContain(c => c.GetType() == typeof(TorrentInfo));
|
||||
|
||||
ValidateResult(reports, hasSize, hasInfoUrl);
|
||||
|
||||
reports.Should().OnlyContain(c => c.DownloadProtocol == DownloadProtocol.Torrent);
|
||||
|
||||
if (hasMagnet)
|
||||
{
|
||||
reports.Cast<TorrentInfo>().Should().OnlyContain(c => c.MagnetUrl.StartsWith("magnet:"));
|
||||
}
|
||||
}
|
||||
|
||||
private void ValidateResult(IList<ReleaseInfo> reports, bool hasSize = false, bool hasInfoUrl = false)
|
||||
{
|
||||
reports.Should().NotBeEmpty();
|
||||
@@ -194,19 +210,5 @@ namespace NzbDrone.Core.Test.IndexerTests.IntegrationTests
|
||||
}
|
||||
}
|
||||
|
||||
private void ValidateTorrentResult(IList<ReleaseInfo> reports, bool hasSize = false, bool hasInfoUrl = false, bool hasMagnet = false)
|
||||
{
|
||||
reports.Should().OnlyContain(c => c.GetType() == typeof(TorrentInfo));
|
||||
|
||||
ValidateResult(reports, hasSize, hasInfoUrl);
|
||||
|
||||
reports.Should().OnlyContain(c => c.DownloadProtocol == DownloadProtocol.Torrent);
|
||||
|
||||
if (hasMagnet)
|
||||
{
|
||||
reports.Cast<TorrentInfo>().Should().OnlyContain(c => c.MagnetUrl.StartsWith("magnet:"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user