From c2b5fb78ced9bad0bc2283d6ff7fe0c2f6547e70 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Thu, 9 Apr 2020 19:27:03 +0200 Subject: [PATCH] Address comments --- Emby.Server.Implementations/Data/SqliteItemRepository.cs | 7 ++++--- MediaBrowser.Controller/Persistence/IItemRepository.cs | 2 -- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index d240b1e39..95678b7dc 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -3315,7 +3315,7 @@ namespace Emby.Server.Implementations.Data for (int i = 0; i < str.Length; i++) { - if (!char.IsLetter(str[i]) && (!char.IsNumber(str[i]))) + if (!char.IsLetter(str[i]) && !char.IsNumber(str[i])) { return false; } @@ -3646,18 +3646,19 @@ namespace Emby.Server.Implementations.Data int trailerTypesLen = trailerTypes.Length; if (trailerTypesLen > 0) { + const string Or = " OR "; StringBuilder clause = new StringBuilder("(", trailerTypesLen * 32); for (int i = 0; i < trailerTypesLen; i++) { var paramName = "@TrailerTypes" + i; clause.Append("TrailerTypes like ") .Append(paramName) - .Append(" OR "); + .Append(Or); statement?.TryBind(paramName, "%" + trailerTypes[i] + "%"); } // Remove last " OR " - clause.Length -= 4; + clause.Length -= Or.Length; clause.Append(')'); whereClauses.Add(clause.ToString()); diff --git a/MediaBrowser.Controller/Persistence/IItemRepository.cs b/MediaBrowser.Controller/Persistence/IItemRepository.cs index 3bce79d8a..75fc43a04 100644 --- a/MediaBrowser.Controller/Persistence/IItemRepository.cs +++ b/MediaBrowser.Controller/Persistence/IItemRepository.cs @@ -24,7 +24,6 @@ namespace MediaBrowser.Controller.Persistence /// Deletes the item. /// /// The identifier. - /// The cancellation token. void DeleteItem(Guid id); /// @@ -169,4 +168,3 @@ namespace MediaBrowser.Controller.Persistence List GetAllArtistNames(); } } -