feat: add fflate library for file decompression and implement file download functionality in BookOfflineButton component
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 5m18s

This commit is contained in:
Julien Froidefond
2026-01-04 11:32:48 +01:00
parent 0d33462349
commit 1ffe99285d
5 changed files with 161 additions and 65 deletions

View File

@@ -115,6 +115,27 @@ export class BookService extends BaseApiService {
}
}
static async getFile(bookId: string): Promise<Response> {
try {
const config = await this.getKomgaConfig();
const url = this.buildUrl(config, `books/${bookId}/file`);
const headers = this.getAuthHeaders(config);
const response = await fetch(url, {
method: "GET",
headers,
});
if (!response.ok) {
throw new AppError(ERROR_CODES.BOOK.NOT_FOUND);
}
return response;
} catch (error) {
throw new AppError(ERROR_CODES.BOOK.NOT_FOUND, {}, error);
}
}
static async getCover(bookId: string): Promise<Response> {
try {
// Récupérer les préférences de l'utilisateur