Skip to content

Commit 2f5cdd1

Browse files
authored
fix(tv): materialize TV request search before filtering to avoid EF Core 500 (#5421)
* fix(tv): materialize TV request search before filtering to avoid EF Core translation error The SearchTvRequest method applied a Where clause using the custom StringHelper.Contains overload on an IQueryable, causing EF Core to attempt (and fail) to translate it to SQL, returning HTTP 500. Materialize the results with ToListAsync first, then filter in memory, mirroring MovieRequestEngine.SearchMovieRequest. Fixes #5420 * ci: remove duplicate 'spec' key in automation-tests smoke step The Cypress smoke test step defined 'spec' twice, making the workflow file invalid. Remove the stray duplicate so the workflow parses and runs.
1 parent d699405 commit 2f5cdd1

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/automation-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ jobs:
238238
spec: "cypress/features/01-wizard/wizard.feature,cypress/features/login/login.feature,cypress/tests/login/login.spec.ts"
239239
wait-on: http://localhost:3577/
240240
wait-on-timeout: 600
241-
spec: cypress/features/01-wizard/wizard.feature
242241
env:
243242
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
244243
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

src/Ombi.Core/Engine/TvRequestEngine.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,9 @@ public async Task<IEnumerable<TvRequests>> SearchTvRequest(string search)
645645
{
646646
allRequests = TvRepository.Get();
647647
}
648-
var results = await allRequests.Where(x => x.Title.Contains(search, CompareOptions.IgnoreCase)).ToListAsync();
648+
var results = (await allRequests.ToListAsync())
649+
.Where(x => x.Title.Contains(search, CompareOptions.IgnoreCase))
650+
.ToList();
649651

650652
await FillAdditionalFields(shouldHide, results);
651653
return results;

0 commit comments

Comments
 (0)