core: clean up cardigann parser guid #10092 (#10609)

This commit is contained in:
Diego Heras 2020-12-22 18:49:59 +01:00 committed by GitHub
parent edce56f363
commit 6e527823b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View File

@ -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;

View File

@ -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":