From 7bd1de3df60e5c698eed5d955b4ac71d73614a09 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Wed, 9 Apr 2025 00:00:16 +0200 Subject: [PATCH] Fix `nextEntry` query in history (alias mismatch) --- api/src/controllers/profiles/history.ts | 4 ++-- api/tests/series/nextup.test.ts | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/api/src/controllers/profiles/history.ts b/api/src/controllers/profiles/history.ts index 68379fde..ec605ea1 100644 --- a/api/src/controllers/profiles/history.ts +++ b/api/src/controllers/profiles/history.ts @@ -206,11 +206,11 @@ export const historyH = new Elysia({ tags: ["profiles"] }) .where( and( eq(nextEntry.showPk, entries.showPk), - ne(entries.kind, "extra"), + ne(nextEntry.kind, "extra"), gt(nextEntry.order, entries.order), ), ) - .orderBy(nextEntry.showPk, entries.order) + .orderBy(nextEntry.order) .limit(1) .as("nextEntryQ"); diff --git a/api/tests/series/nextup.test.ts b/api/tests/series/nextup.test.ts index 01613775..af25062b 100644 --- a/api/tests/series/nextup.test.ts +++ b/api/tests/series/nextup.test.ts @@ -3,10 +3,7 @@ import { addToHistory, createMovie, createSerie, - getEntries, - getHistory, getMovie, - getNews, getNextup, getSerie, getWatchlist,