perf: strip unused fields from book list API response (#2741)

* perf: strip unused fields from book list API response

* fix: regenerate package-lock.json to sync with package.json
This commit is contained in:
ACX
2026-02-13 22:09:01 -07:00
committed by GitHub
parent 77b4deb942
commit ffd2adb032
5 changed files with 650 additions and 10 deletions
@@ -239,6 +239,7 @@ export interface BookMetadata {
contentRating?: string | null;
ageRatingLocked?: boolean;
contentRatingLocked?: boolean;
allMetadataLocked?: boolean;
[key: string]: unknown;
}
@@ -88,10 +88,7 @@ export class SortService {
hardcoverRating: (book) => book.metadata?.hardcoverRating || null,
hardcoverReviewCount: (book) => book.metadata?.hardcoverReviewCount || null,
ranobedbRating: (book) => book.metadata?.ranobedbRating || null,
locked: (book) =>
Object.keys(book.metadata ?? {})
.filter((key) => key.endsWith('Locked'))
.every((key) => book.metadata?.[key] === true),
locked: (book) => book.metadata?.allMetadataLocked ?? false,
lastReadTime: (book) => book.lastReadTime ? new Date(book.lastReadTime).getTime() : null,
addedOn: (book) => book.addedOn ? new Date(book.addedOn).getTime() : null,
fileSizeKb: (book) => book.fileSizeKb || null,