mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-30 05:53:41 +02:00
gazelletracker abstract: improve imdb in tags processing (#6085)
Replaced foreach loop with more efficient LINQ
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user