From 2174579cc1ec535915c26c4e3bdc8016d9bf2f50 Mon Sep 17 00:00:00 2001 From: Froidefond Julien Date: Sun, 15 Mar 2026 21:19:20 +0100 Subject: [PATCH] fix: hide "mark as unread" button on unread books for Stripstream provider Return null for readProgress when Stripstream book status is "unread" with no current page, aligning behavior with Komga provider. Co-Authored-By: Claude Opus 4.6 --- .../stripstream/stripstream.adapter.ts | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/lib/providers/stripstream/stripstream.adapter.ts b/src/lib/providers/stripstream/stripstream.adapter.ts index 17fadf7..875e718 100644 --- a/src/lib/providers/stripstream/stripstream.adapter.ts +++ b/src/lib/providers/stripstream/stripstream.adapter.ts @@ -34,11 +34,14 @@ export class StripstreamAdapter { volume: book.volume ?? null, pageCount: book.page_count ?? 0, thumbnailUrl: `/api/stripstream/images/books/${book.id}/thumbnail`, - readProgress: { - page: book.reading_current_page ?? null, - completed: book.reading_status === "read", - lastReadAt: book.reading_last_read_at ?? null, - }, + readProgress: + book.reading_status === "unread" && !book.reading_current_page + ? null + : { + page: book.reading_current_page ?? null, + completed: book.reading_status === "read", + lastReadAt: book.reading_last_read_at ?? null, + }, }; } @@ -52,11 +55,14 @@ export class StripstreamAdapter { volume: book.volume ?? null, pageCount: book.page_count ?? 0, thumbnailUrl: `/api/stripstream/images/books/${book.id}/thumbnail`, - readProgress: { - page: book.reading_current_page ?? null, - completed: book.reading_status === "read", - lastReadAt: book.reading_last_read_at ?? null, - }, + readProgress: + book.reading_status === "unread" && !book.reading_current_page + ? null + : { + page: book.reading_current_page ?? null, + completed: book.reading_status === "read", + lastReadAt: book.reading_last_read_at ?? null, + }, }; }