aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Providers/People/TvdbPersonImageProvider.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Providers/People/TvdbPersonImageProvider.cs')
-rw-r--r--MediaBrowser.Providers/People/TvdbPersonImageProvider.cs8
1 files changed, 5 insertions, 3 deletions
diff --git a/MediaBrowser.Providers/People/TvdbPersonImageProvider.cs b/MediaBrowser.Providers/People/TvdbPersonImageProvider.cs
index 253acc13f1..0258fd539a 100644
--- a/MediaBrowser.Providers/People/TvdbPersonImageProvider.cs
+++ b/MediaBrowser.Providers/People/TvdbPersonImageProvider.cs
@@ -56,10 +56,12 @@ namespace MediaBrowser.Providers.People
public Task<IEnumerable<RemoteImageInfo>> GetImages(IHasImages item, CancellationToken cancellationToken)
{
+ // Avoid implicitly captured closure
+ var itemName = item.Name;
+
var seriesWithPerson = _library.RootFolder
- .RecursiveChildren
- .OfType<Series>()
- .Where(i => !string.IsNullOrEmpty(i.GetProviderId(MetadataProviders.Tvdb)) && i.People.Any(p => string.Equals(p.Name, item.Name, StringComparison.OrdinalIgnoreCase)))
+ .GetRecursiveChildren(i => i is Series && !string.IsNullOrEmpty(i.GetProviderId(MetadataProviders.Tvdb)) && i.People.Any(p => string.Equals(p.Name, itemName, StringComparison.OrdinalIgnoreCase)))
+ .Cast<Series>()
.ToList();
var infos = seriesWithPerson.Select(i => GetImageFromSeriesData(i, item.Name, cancellationToken))