From 6e527823b55adf3edcd2b948b24ce57f02eacfda Mon Sep 17 00:00:00 2001 From: Diego Heras Date: Tue, 22 Dec 2020 18:49:59 +0100 Subject: [PATCH] core: clean up cardigann parser guid #10092 (#10609) --- src/Jackett.Common/Indexers/BaseIndexer.cs | 11 +++++++++++ src/Jackett.Common/Indexers/CardigannIndexer.cs | 4 ---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Jackett.Common/Indexers/BaseIndexer.cs b/src/Jackett.Common/Indexers/BaseIndexer.cs index c36e447b6..8ebeca0b9 100644 --- a/src/Jackett.Common/Indexers/BaseIndexer.cs +++ b/src/Jackett.Common/Indexers/BaseIndexer.cs @@ -284,6 +284,17 @@ namespace Jackett.Common.Indexers if (r.MagnetUri != null && string.IsNullOrWhiteSpace(r.InfoHash)) r.InfoHash = MagnetUtil.MagnetToInfoHash(r.MagnetUri); + // set guid + if (r.Guid == null) + { + if (r.Details != null) + r.Guid = r.Details; + else if (r.Link != null) + r.Guid = r.Link; + else if (r.MagnetUri != null) + r.Guid = r.MagnetUri; + } + return r; }); return fixedResults; diff --git a/src/Jackett.Common/Indexers/CardigannIndexer.cs b/src/Jackett.Common/Indexers/CardigannIndexer.cs index e4cecb976..4e750633e 100644 --- a/src/Jackett.Common/Indexers/CardigannIndexer.cs +++ b/src/Jackett.Common/Indexers/CardigannIndexer.cs @@ -1382,8 +1382,6 @@ namespace Jackett.Common.Indexers var magnetUri = new Uri(value); release.MagnetUri = magnetUri; value = magnetUri.ToString(); - if (release.Guid == null) - release.Guid = magnetUri; break; case "infohash": release.InfoHash = value; @@ -1391,8 +1389,6 @@ namespace Jackett.Common.Indexers case "details": var url = resolvePath(value, searchUrlUri); release.Details = url; - if (release.Guid == null) - release.Guid = url; value = url.ToString(); break; case "title":