aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Data/SqliteItemRepository.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-09-09 23:47:58 -0400
committerGitHub <noreply@github.com>2017-09-09 23:47:58 -0400
commitdbf23fbd126a141c5c2cc05215c328d153b8255c (patch)
tree051101085376bd10a7c7be29532dcd4ae4e1b60d /Emby.Server.Implementations/Data/SqliteItemRepository.cs
parent926d976e84b62fd939811221d92fca45c96c02de (diff)
parent9440fdc719880ba9b8a7ecf5991cff98774bf49c (diff)
Merge pull request #2875 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Server.Implementations/Data/SqliteItemRepository.cs')
-rw-r--r--Emby.Server.Implementations/Data/SqliteItemRepository.cs48
1 files changed, 48 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
index b5bc7692e..ea3845f0c 100644
--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
@@ -4254,6 +4254,54 @@ namespace Emby.Server.Implementations.Data
}
}
+ if (!string.IsNullOrWhiteSpace(query.HasNoAudioTrackWithLanguage))
+ {
+ whereClauses.Add("((select language from MediaStreams where MediaStreams.ItemId=A.Guid and MediaStreams.StreamType='Audio' and MediaStreams.Language=@HasNoAudioTrackWithLanguage limit 1) is null)");
+ if (statement != null)
+ {
+ statement.TryBind("@HasNoAudioTrackWithLanguage", query.HasNoAudioTrackWithLanguage);
+ }
+ }
+
+ if (!string.IsNullOrWhiteSpace(query.HasNoInternalSubtitleTrackWithLanguage))
+ {
+ whereClauses.Add("((select language from MediaStreams where MediaStreams.ItemId=A.Guid and MediaStreams.StreamType='Subtitle' and MediaStreams.IsExternal=0 and MediaStreams.Language=@HasNoInternalSubtitleTrackWithLanguage limit 1) is null)");
+ if (statement != null)
+ {
+ statement.TryBind("@HasNoInternalSubtitleTrackWithLanguage", query.HasNoInternalSubtitleTrackWithLanguage);
+ }
+ }
+
+ if (!string.IsNullOrWhiteSpace(query.HasNoExternalSubtitleTrackWithLanguage))
+ {
+ whereClauses.Add("((select language from MediaStreams where MediaStreams.ItemId=A.Guid and MediaStreams.StreamType='Subtitle' and MediaStreams.IsExternal=1 and MediaStreams.Language=@HasNoExternalSubtitleTrackWithLanguage limit 1) is null)");
+ if (statement != null)
+ {
+ statement.TryBind("@HasNoExternalSubtitleTrackWithLanguage", query.HasNoExternalSubtitleTrackWithLanguage);
+ }
+ }
+
+ if (!string.IsNullOrWhiteSpace(query.HasNoSubtitleTrackWithLanguage))
+ {
+ whereClauses.Add("((select language from MediaStreams where MediaStreams.ItemId=A.Guid and MediaStreams.StreamType='Subtitle' and MediaStreams.Language=@HasNoSubtitleTrackWithLanguage limit 1) is null)");
+ if (statement != null)
+ {
+ statement.TryBind("@HasNoSubtitleTrackWithLanguage", query.HasNoSubtitleTrackWithLanguage);
+ }
+ }
+
+ if (query.HasChapterImages.HasValue)
+ {
+ if (query.HasChapterImages.Value)
+ {
+ whereClauses.Add("((select imagepath from Chapters2 where Chapters2.ItemId=A.Guid and imagepath not null limit 1) not null)");
+ }
+ else
+ {
+ whereClauses.Add("((select imagepath from Chapters2 where Chapters2.ItemId=A.Guid and imagepath not null limit 1) is null)");
+ }
+ }
+
if (query.HasDeadParentId.HasValue && query.HasDeadParentId.Value)
{
whereClauses.Add("ParentId NOT NULL AND ParentId NOT IN (select guid from TypedBaseItems)");