aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Library/LocalTrailerPostScanTask.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/LocalTrailerPostScanTask.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Library/LocalTrailerPostScanTask.cs15
1 files changed, 9 insertions, 6 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/LocalTrailerPostScanTask.cs b/MediaBrowser.Server.Implementations/Library/LocalTrailerPostScanTask.cs
index b72406730..4e23b5e93 100644
--- a/MediaBrowser.Server.Implementations/Library/LocalTrailerPostScanTask.cs
+++ b/MediaBrowser.Server.Implementations/Library/LocalTrailerPostScanTask.cs
@@ -4,6 +4,7 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Channels;
using MediaBrowser.Model.Entities;
using System;
+using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
@@ -28,12 +29,14 @@ namespace MediaBrowser.Server.Implementations.Library
.Cast<IHasTrailers>()
.ToList();
- var channelTrailerResult = await _channelManager.GetAllMediaInternal(new AllChannelMediaQuery
+ var trailers = _libraryManager.GetItemList(new InternalItemsQuery
{
- ExtraTypes = new[] { ExtraType.Trailer }
-
- }, CancellationToken.None);
- var channelTrailers = channelTrailerResult.Items;
+ IncludeItemTypes = new[] { typeof(Trailer).Name },
+ ExcludeTrailerTypes = new[]
+ {
+ TrailerType.LocalTrailer
+ }
+ }).ToArray();
var numComplete = 0;
@@ -41,7 +44,7 @@ namespace MediaBrowser.Server.Implementations.Library
{
cancellationToken.ThrowIfCancellationRequested();
- await AssignTrailers(item, channelTrailers).ConfigureAwait(false);
+ await AssignTrailers(item, trailers).ConfigureAwait(false);
numComplete++;
double percent = numComplete;