aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-04-29 23:59:46 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-04-29 23:59:46 -0400
commit1a02365f781f01e1efe9b12241a7368ae1cd5ba8 (patch)
tree7aedca446c012143f1918c8e3afecb0f67d59b1b
parenta4f1c264b098fd691f12d377d11665917a6c057c (diff)
cinema mode fixes
-rw-r--r--MediaBrowser.Controller/Entities/InternalItemsQuery.cs2
-rw-r--r--MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs7
-rw-r--r--MediaBrowser.Server.Implementations/Library/LocalTrailerPostScanTask.cs11
-rw-r--r--MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs14
4 files changed, 8 insertions, 26 deletions
diff --git a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs
index fbf246b3a..f3b4f4053 100644
--- a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs
+++ b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs
@@ -123,7 +123,6 @@ namespace MediaBrowser.Controller.Entities
public SourceType[] SourceTypes { get; set; }
public SourceType[] ExcludeSourceTypes { get; set; }
public TrailerType[] TrailerTypes { get; set; }
- public TrailerType[] ExcludeTrailerTypes { get; set; }
public DayOfWeek[] AirDays { get; set; }
public SeriesStatus[] SeriesStatuses { get; set; }
@@ -165,7 +164,6 @@ namespace MediaBrowser.Controller.Entities
SourceTypes = new SourceType[] { };
ExcludeSourceTypes = new SourceType[] { };
TrailerTypes = new TrailerType[] { };
- ExcludeTrailerTypes = new TrailerType[] { };
AirDays = new DayOfWeek[] { };
SeriesStatuses = new SeriesStatus[] { };
}
diff --git a/MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs b/MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs
index 9ebae5d91..49012c65a 100644
--- a/MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs
+++ b/MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs
@@ -102,15 +102,10 @@ namespace MediaBrowser.Server.Implementations.Intros
if (trailerTypes.Count > 0)
{
- var excludeTrailerTypes = Enum.GetNames(typeof(TrailerType))
- .Select(i => (TrailerType)Enum.Parse(typeof(TrailerType), i, true))
- .Except(trailerTypes)
- .ToArray();
-
var trailerResult = _libraryManager.GetItemList(new InternalItemsQuery
{
IncludeItemTypes = new[] { typeof(Trailer).Name },
- ExcludeTrailerTypes = excludeTrailerTypes
+ TrailerTypes = trailerTypes.ToArray()
});
candidates.AddRange(trailerResult.Select(i => new ItemWithTrailer
diff --git a/MediaBrowser.Server.Implementations/Library/LocalTrailerPostScanTask.cs b/MediaBrowser.Server.Implementations/Library/LocalTrailerPostScanTask.cs
index 96d570ef9..5fc9c3168 100644
--- a/MediaBrowser.Server.Implementations/Library/LocalTrailerPostScanTask.cs
+++ b/MediaBrowser.Server.Implementations/Library/LocalTrailerPostScanTask.cs
@@ -27,13 +27,16 @@ namespace MediaBrowser.Server.Implementations.Library
.Cast<IHasTrailers>()
.ToList();
+ var trailerTypes = Enum.GetNames(typeof(TrailerType))
+ .Select(i => (TrailerType)Enum.Parse(typeof(TrailerType), i, true))
+ .Except(new[] { TrailerType.LocalTrailer })
+ .ToArray();
+
var trailers = _libraryManager.GetItemList(new InternalItemsQuery
{
IncludeItemTypes = new[] { typeof(Trailer).Name },
- ExcludeTrailerTypes = new[]
- {
- TrailerType.LocalTrailer
- }
+ TrailerTypes = trailerTypes
+
}).ToArray();
var numComplete = 0;
diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
index 783bd5ff4..4f724fe40 100644
--- a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
+++ b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
@@ -1961,20 +1961,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
whereClauses.Add(clause);
}
- if (query.ExcludeTrailerTypes.Length > 0)
- {
- var clauses = new List<string>();
- var index = 0;
- foreach (var type in query.ExcludeTrailerTypes)
- {
- clauses.Add("(TrailerTypes is null OR TrailerTypes not like @TrailerTypes" + index + ")");
- cmd.Parameters.Add(cmd, "@TrailerTypes" + index, DbType.String).Value = "%" + type + "%";
- index++;
- }
- var clause = "(" + string.Join(" AND ", clauses.ToArray()) + ")";
- whereClauses.Add(clause);
- }
-
if (query.IsAiring.HasValue)
{
if (query.IsAiring.Value)