mirror of
https://github.com/Jackett/Jackett
synced 2025-02-23 23:00:51 +00:00
gazelletracker abstract: improve imdb in tags processing (#6085)
Replaced foreach loop with more efficient LINQ
This commit is contained in:
parent
c69f621ed4
commit
86218debd1
1 changed files with 5 additions and 16 deletions
|
@ -190,22 +190,11 @@ namespace Jackett.Common.Indexers.Abstract
|
||||||
|
|
||||||
if (imdbInTags)
|
if (imdbInTags)
|
||||||
{
|
{
|
||||||
int? currentTagImdbId;
|
var imdbTags = tags
|
||||||
// Check if multiple IMDb IDs exist
|
.Select(tag => ParseUtil.GetImdbID((string)tag))
|
||||||
// If they do, show no IMDb link
|
.Where(tag => tag != null);
|
||||||
foreach (var tag in tags)
|
if (imdbTags.Count() == 1)
|
||||||
{
|
release.Imdb = imdbTags.First();
|
||||||
currentTagImdbId = ParseUtil.GetImdbID((string)tag);
|
|
||||||
if (currentTagImdbId != null && release.Imdb == null)
|
|
||||||
{
|
|
||||||
release.Imdb = currentTagImdbId;
|
|
||||||
}
|
|
||||||
else if (currentTagImdbId != null)
|
|
||||||
{
|
|
||||||
release.Imdb = null;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r["torrents"] is JArray)
|
if (r["torrents"] is JArray)
|
||||||
|
|
Loading…
Reference in a new issue