Skip to content

Commit

Permalink
core: clean up cardigann parser guid #10092 (#10609)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngosang committed Dec 22, 2020
1 parent edce56f commit 6e52782
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 11 additions & 0 deletions src/Jackett.Common/Indexers/BaseIndexer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,17 @@ protected virtual IEnumerable<ReleaseInfo> FixResults(TorznabQuery query, IEnume
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;
Expand Down
4 changes: 0 additions & 4 deletions src/Jackett.Common/Indexers/CardigannIndexer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1382,17 +1382,13 @@ protected override async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuer
var magnetUri = new Uri(value);
release.MagnetUri = magnetUri;
value = magnetUri.ToString();
if (release.Guid == null)
release.Guid = magnetUri;
break;
case "infohash":
release.InfoHash = value;
break;
case "details":
var url = resolvePath(value, searchUrlUri);
release.Details = url;
if (release.Guid == null)
release.Guid = url;
value = url.ToString();
break;
case "title":
Expand Down

0 comments on commit 6e52782

Please sign in to comment.