Fixed: (Redacted) Guid and FL Parsing in line with Gazelle

http2
Qstick 3 years ago
parent 8a5194e604
commit 1e532624af

@ -221,9 +221,11 @@ namespace NzbDrone.Core.Indexers.Definitions
title += " [Cue]"; title += " [Cue]";
} }
var infoUrl = GetInfoUrl(result.GroupId, id);
GazelleInfo release = new GazelleInfo() GazelleInfo release = new GazelleInfo()
{ {
Guid = string.Format("Redacted-{0}", id), Guid = infoUrl,
// Splice Title from info to avoid calling API again for every torrent. // Splice Title from info to avoid calling API again for every torrent.
Title = WebUtility.HtmlDecode(title), Title = WebUtility.HtmlDecode(title),
@ -232,7 +234,7 @@ namespace NzbDrone.Core.Indexers.Definitions
Codec = torrent.Format, Codec = torrent.Format,
Size = long.Parse(torrent.Size), Size = long.Parse(torrent.Size),
DownloadUrl = GetDownloadUrl(id, torrent.CanUseToken), DownloadUrl = GetDownloadUrl(id, torrent.CanUseToken),
InfoUrl = GetInfoUrl(result.GroupId, id), InfoUrl = infoUrl,
Seeders = int.Parse(torrent.Seeders), Seeders = int.Parse(torrent.Seeders),
Peers = int.Parse(torrent.Leechers) + int.Parse(torrent.Seeders), Peers = int.Parse(torrent.Leechers) + int.Parse(torrent.Seeders),
PublishDate = torrent.Time.ToUniversalTime(), PublishDate = torrent.Time.ToUniversalTime(),
@ -240,6 +242,8 @@ namespace NzbDrone.Core.Indexers.Definitions
Freeleech = torrent.IsFreeLeech || torrent.IsPersonalFreeLeech, Freeleech = torrent.IsFreeLeech || torrent.IsPersonalFreeLeech,
Files = torrent.FileCount, Files = torrent.FileCount,
Grabs = torrent.Snatches, Grabs = torrent.Snatches,
DownloadVolumeFactor = torrent.IsFreeLeech || torrent.IsNeutralLeech || torrent.IsPersonalFreeLeech ? 0 : 1,
UploadVolumeFactor = torrent.IsNeutralLeech ? 0 : 1
}; };
var category = torrent.Category; var category = torrent.Category;
@ -260,19 +264,23 @@ namespace NzbDrone.Core.Indexers.Definitions
else else
{ {
var id = result.TorrentId; var id = result.TorrentId;
var infoUrl = GetInfoUrl(result.GroupId, id);
GazelleInfo release = new GazelleInfo() GazelleInfo release = new GazelleInfo()
{ {
Guid = string.Format("Redacted-{0}", id), Guid = infoUrl,
Title = WebUtility.HtmlDecode(result.GroupName), Title = WebUtility.HtmlDecode(result.GroupName),
Size = long.Parse(result.Size), Size = long.Parse(result.Size),
DownloadUrl = GetDownloadUrl(id, result.CanUseToken), DownloadUrl = GetDownloadUrl(id, result.CanUseToken),
InfoUrl = GetInfoUrl(result.GroupId, id), InfoUrl = infoUrl,
Seeders = int.Parse(result.Seeders), Seeders = int.Parse(result.Seeders),
Peers = int.Parse(result.Leechers) + int.Parse(result.Seeders), Peers = int.Parse(result.Leechers) + int.Parse(result.Seeders),
PublishDate = DateTimeOffset.FromUnixTimeSeconds(result.GroupTime).UtcDateTime, PublishDate = DateTimeOffset.FromUnixTimeSeconds(result.GroupTime).UtcDateTime,
Freeleech = result.IsFreeLeech || result.IsPersonalFreeLeech, Freeleech = result.IsFreeLeech || result.IsPersonalFreeLeech,
Files = result.FileCount, Files = result.FileCount,
Grabs = result.Snatches, Grabs = result.Snatches,
DownloadVolumeFactor = result.IsFreeLeech || result.IsNeutralLeech || result.IsPersonalFreeLeech ? 0 : 1,
UploadVolumeFactor = result.IsNeutralLeech ? 0 : 1
}; };
var category = result.Category; var category = result.Category;

Loading…
Cancel
Save