mirror of
https://github.com/Prowlarr/Prowlarr
synced 2026-02-05 14:32:06 +01:00
Fixed: (Gazelle) Use InfoUrl for GUID to avoid global duplicates
This commit is contained in:
parent
a5e13ca776
commit
b9dfe5e359
1 changed files with 24 additions and 5 deletions
|
|
@ -52,6 +52,8 @@ public virtual IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
|
|||
|
||||
foreach (var result in jsonResponse.Resource.Response.Results)
|
||||
{
|
||||
var posterUrl = GetPosterUrl(result.Cover);
|
||||
|
||||
if (result.Torrents != null)
|
||||
{
|
||||
foreach (var torrent in result.Torrents)
|
||||
|
|
@ -66,9 +68,11 @@ public virtual IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
|
|||
title += " [Cue]";
|
||||
}
|
||||
|
||||
var infoUrl = GetInfoUrl(result.GroupId, id);
|
||||
|
||||
var release = new GazelleInfo()
|
||||
{
|
||||
Guid = string.Format("Gazelle-{0}", id),
|
||||
Guid = infoUrl,
|
||||
Title = WebUtility.HtmlDecode(title),
|
||||
Container = torrent.Encoding,
|
||||
Files = torrent.FileCount,
|
||||
|
|
@ -76,11 +80,12 @@ public virtual IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
|
|||
Codec = torrent.Format,
|
||||
Size = long.Parse(torrent.Size),
|
||||
DownloadUrl = GetDownloadUrl(id),
|
||||
InfoUrl = GetInfoUrl(result.GroupId, id),
|
||||
InfoUrl = infoUrl,
|
||||
Seeders = int.Parse(torrent.Seeders),
|
||||
Peers = int.Parse(torrent.Leechers) + int.Parse(torrent.Seeders),
|
||||
PublishDate = torrent.Time.ToUniversalTime(),
|
||||
Scene = torrent.Scene,
|
||||
PosterUrl = posterUrl
|
||||
};
|
||||
|
||||
var category = torrent.Category;
|
||||
|
|
@ -100,19 +105,21 @@ public virtual IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
|
|||
{
|
||||
var id = result.TorrentId;
|
||||
var groupName = WebUtility.HtmlDecode(result.GroupName);
|
||||
var infoUrl = GetInfoUrl(result.GroupId, id);
|
||||
|
||||
var release = new GazelleInfo()
|
||||
{
|
||||
Guid = string.Format("Gazelle-{0}", id),
|
||||
Guid = infoUrl,
|
||||
Title = groupName,
|
||||
Size = long.Parse(result.Size),
|
||||
DownloadUrl = GetDownloadUrl(id),
|
||||
InfoUrl = GetInfoUrl(result.GroupId, id),
|
||||
InfoUrl = infoUrl,
|
||||
Seeders = int.Parse(result.Seeders),
|
||||
Peers = int.Parse(result.Leechers) + int.Parse(result.Seeders),
|
||||
Files = result.FileCount,
|
||||
Grabs = result.Snatches,
|
||||
PublishDate = DateTimeOffset.FromUnixTimeSeconds(result.GroupTime).UtcDateTime,
|
||||
PosterUrl = posterUrl
|
||||
};
|
||||
|
||||
var category = result.Category;
|
||||
|
|
@ -147,7 +154,19 @@ protected virtual string GetDownloadUrl(int torrentId)
|
|||
return url.FullUri;
|
||||
}
|
||||
|
||||
private string GetInfoUrl(string groupId, int torrentId)
|
||||
protected virtual string GetPosterUrl(string cover)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(cover))
|
||||
{
|
||||
return cover.StartsWith("http") ?
|
||||
new HttpUri(cover).FullUri :
|
||||
new HttpUri(_settings.BaseUrl).CombinePath(cover).FullUri;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
protected virtual string GetInfoUrl(string groupId, int torrentId)
|
||||
{
|
||||
var url = new HttpUri(_settings.BaseUrl)
|
||||
.CombinePath("/torrents.php")
|
||||
|
|
|
|||
Loading…
Reference in a new issue