From 602d003e7b8345722a6dea65137459f23c2deab1 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 17 May 2016 16:04:20 -0400 Subject: [PATCH] update image loading --- .../Persistence/SqliteItemRepository.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs index e04c87917..78e0bce17 100644 --- a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs +++ b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs @@ -2405,17 +2405,20 @@ namespace MediaBrowser.Server.Implementations.Persistence cmd.Parameters.Add(cmd, "@IsFavorite", DbType.Boolean).Value = query.IsFavorite.Value; } - if (query.IsPlayed.HasValue) + if (EnableJoinUserData(query)) { - if (query.IsPlayed.Value) + if (query.IsPlayed.HasValue) { - whereClauses.Add("(played=@IsPlayed)"); + if (query.IsPlayed.Value) + { + whereClauses.Add("(played=@IsPlayed)"); + } + else + { + whereClauses.Add("(played is null or played=@IsPlayed)"); + } + cmd.Parameters.Add(cmd, "@IsPlayed", DbType.Boolean).Value = query.IsPlayed.Value; } - else - { - whereClauses.Add("(played is null or played=@IsPlayed)"); - } - cmd.Parameters.Add(cmd, "@IsPlayed", DbType.Boolean).Value = query.IsPlayed.Value; } if (query.IsResumable.HasValue)