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:
parent
c69f621ed4
commit
86218debd1
1 changed files with 5 additions and 16 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue