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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user