mirror of
https://github.com/Prowlarr/Prowlarr
synced 2026-04-22 04:40:59 +02:00
New: Set GUID in IndexerBase if Indexer doesn't set it explicitly
This commit is contained in:
parent
0fd411a37f
commit
510ccf4bce
1 changed files with 19 additions and 2 deletions
|
|
@ -105,10 +105,27 @@ public virtual object RequestAction(string action, IDictionary<string, string> q
|
|||
|
||||
protected virtual IList<ReleaseInfo> CleanupReleases(IEnumerable<ReleaseInfo> releases)
|
||||
{
|
||||
var result = releases.DistinctBy(v => v.Guid).ToList();
|
||||
var result = releases.ToList();
|
||||
|
||||
result.ForEach(c =>
|
||||
{
|
||||
//Set GUID if not set
|
||||
if (c.Guid.IsNullOrWhiteSpace())
|
||||
{
|
||||
if (c.DownloadUrl.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
c.Guid = c.DownloadUrl;
|
||||
}
|
||||
else if (Protocol == DownloadProtocol.Torrent && ((TorrentInfo)c).MagnetUrl.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
c.Guid = ((TorrentInfo)c).MagnetUrl;
|
||||
}
|
||||
else if (c.InfoUrl.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
c.Guid = c.InfoUrl;
|
||||
}
|
||||
}
|
||||
|
||||
//Set common props
|
||||
c.IndexerId = Definition.Id;
|
||||
c.Indexer = Definition.Name;
|
||||
|
|
@ -122,7 +139,7 @@ protected virtual IList<ReleaseInfo> CleanupReleases(IEnumerable<ReleaseInfo> re
|
|||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
return result.DistinctBy(v => v.Guid).ToList();
|
||||
}
|
||||
|
||||
protected TSettings GetDefaultBaseUrl(TSettings settings)
|
||||
|
|
|
|||
Loading…
Reference in a new issue