refactor(api): optimize caching mechanisms and improve book filtering (#372)

* refactor(api): optimize caching mechanisms and improve book filtering logic

* refactor(preferences): remove unused ExternalDocLinkComponent and enhance translate function typing

* refactor(initializer): add Duration import for improved cache management

* refactor(docker): increase MaxMetaspaceSize for improved memory management

* refactor(repository): replace findAllForSummaryByIds with findAllById

* refactor(cache): implement invalidateAppBooksQueries for improved cache management

* refactor(AppBookService): increase default page size and optimize magic shelf book resolution

* refactor(AppBookSpecification, MagicShelfBookService, TaskCancellationManager, magic-shelf-component): streamline join handling and improve memory management

* refactor(AppBookService, MagicShelfBookService): enhance book retrieval logic and improve error handling

* chore: fix formatting

* chore: fix formatting
This commit is contained in:
brios
2026-04-22 17:27:10 -04:00
committed by Zach Yale
parent 402c6f07c8
commit 3e5a6a9de8
40 changed files with 1296 additions and 429 deletions
@@ -0,0 +1,78 @@
export interface AppPageResponse<T> {
content: T[];
page: number;
size: number;
totalElements: number;
totalPages: number;
hasNext: boolean;
hasPrevious: boolean;
}
export interface AppBookSummary {
id: number;
title: string;
authors: string[];
thumbnailUrl: string | null;
readStatus: string | null;
personalRating: number | null;
seriesName: string | null;
seriesNumber: number | null;
libraryId: number;
addedOn: string | null;
lastReadTime: string | null;
readProgress: number | null;
primaryFileType: string | null;
coverUpdatedOn: string | null;
audiobookCoverUpdatedOn: string | null;
isPhysical: boolean | null;
}
export interface AppFilterOptions {
authors: CountedOption[];
languages: LanguageOption[];
readStatuses: string[];
fileTypes: string[];
categories: CountedOption[];
publishers: CountedOption[];
series: CountedOption[];
tags: CountedOption[];
moods: CountedOption[];
narrators: CountedOption[];
}
export interface CountedOption {
name: string;
count: number;
}
export interface LanguageOption {
code: string;
label: string;
count: number;
}
export interface AppBookFilters {
libraryId?: number;
shelfId?: number;
magicShelfId?: number;
unshelved?: boolean;
status?: string;
search?: string;
fileType?: string;
minRating?: number;
maxRating?: number;
authors?: string[];
language?: string[];
series?: string[];
category?: string[];
publisher?: string[];
tag?: string[];
mood?: string[];
narrator?: string[];
filterMode?: 'and' | 'or' | 'not';
}
export interface AppBookSort {
field: string;
dir: 'asc' | 'desc';
}