aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-10-21 14:41:26 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-10-30 01:36:58 -0400
commit654b13b263cb59e469c8fb7bbcc064f1b3c829a6 (patch)
tree39432f1a2fe02e28107dbb1c17671fc6fc134f3f /MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs
parent8626eded8d987e7eb306d0ec0f17adf83f26b3ae (diff)
update intro provider
Diffstat (limited to 'MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs b/MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs
index a1638f722..b86a5f5d4 100644
--- a/MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs
+++ b/MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs
@@ -108,9 +108,12 @@ namespace MediaBrowser.Server.Implementations.Intros
IsPlayed = config.EnableIntrosForWatchedContent ? (bool?)null : false,
MaxParentalRating = config.EnableIntrosParentalControl ? ratingLevel : null,
BlockUnratedItems = config.EnableIntrosParentalControl ? new[] { UnratedItem.Trailer } : new UnratedItem[] { },
- Limit = config.TrailerLimit,
+
+ // Account for duplicates by imdb id, since the database doesn't support this yet
+ Limit = config.TrailerLimit * 2,
SourceTypes = sourceTypes.ToArray()
- });
+
+ }).Where(i => string.IsNullOrWhiteSpace(i.GetProviderId(MetadataProviders.Imdb)) || !string.Equals(i.GetProviderId(MetadataProviders.Imdb), item.GetProviderId(MetadataProviders.Imdb), StringComparison.OrdinalIgnoreCase)).Take(config.TrailerLimit);
candidates.AddRange(trailerResult.Select(i => new ItemWithTrailer
{