aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-10-22 16:31:23 -0400
committerGitHub <noreply@github.com>2016-10-22 16:31:23 -0400
commit165b4c2fb8868045cd9dae3f00280e1c7b513acb (patch)
tree47a53e6922e3061c7228daa73fb21b72b1e2806e /MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs
parent3c1114228ba3b6a19cb73fa7f9aaa4e3ce3cab80 (diff)
parentce47beba842dc026483dc3649a1efb8c34b30662 (diff)
Merge pull request #2251 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs b/MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs
index a1638f722..f16aa934f 100644
--- a/MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs
+++ b/MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs
@@ -13,7 +13,7 @@ using System.IO;
using System.Linq;
using System.Threading.Tasks;
using CommonIO;
-using MoreLinq;
+using MediaBrowser.Model.Extensions;
namespace MediaBrowser.Server.Implementations.Intros
{
@@ -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
{