1
0
Fork 0
mirror of https://github.com/Jackett/Jackett synced 2025-02-23 14:51:01 +00:00

gazelletracker abstract: improve imdb in tags processing (#6085)

Replaced foreach loop with more efficient LINQ
This commit is contained in:
arielbeje 2019-10-05 23:20:27 +03:00 committed by garfield69
parent c69f621ed4
commit 86218debd1

View file

@ -190,22 +190,11 @@ namespace Jackett.Common.Indexers.Abstract
if (imdbInTags)
{
int? currentTagImdbId;
// Check if multiple IMDb IDs exist
// If they do, show no IMDb link
foreach (var tag in tags)
{
currentTagImdbId = ParseUtil.GetImdbID((string)tag);
if (currentTagImdbId != null && release.Imdb == null)
{
release.Imdb = currentTagImdbId;
}
else if (currentTagImdbId != null)
{
release.Imdb = null;
break;
}
}
var imdbTags = tags
.Select(tag => ParseUtil.GetImdbID((string)tag))
.Where(tag => tag != null);
if (imdbTags.Count() == 1)
release.Imdb = imdbTags.First();
}
if (r["torrents"] is JArray)