feat: refresh in libraries and books lists

This commit is contained in:
Julien Froidefond
2025-02-22 15:36:32 +01:00
parent b208a2aaf6
commit 448cdf6450
7 changed files with 135 additions and 8 deletions

View File

@@ -4,6 +4,7 @@ import { KomgaBook, KomgaSeries } from "@/types/komga";
import { BookService } from "./book.service";
import { ImageService } from "./image.service";
import { PreferencesService } from "./preferences.service";
import { serverCacheService } from "./server-cache.service";
export class SeriesService extends BaseApiService {
static async getSeries(seriesId: string): Promise<KomgaSeries> {
@@ -22,6 +23,10 @@ export class SeriesService extends BaseApiService {
}
}
static async clearSeriesCache(seriesId: string) {
serverCacheService.delete(`series-${seriesId}`);
}
static async getSeriesBooks(
seriesId: string,
page: number = 0,
@@ -48,6 +53,10 @@ export class SeriesService extends BaseApiService {
}
}
static async clearSeriesBooksCache(seriesId: string) {
serverCacheService.deleteAll(`series-${seriesId}-books`);
}
static async getFirstBook(seriesId: string): Promise<string> {
try {
const config = await this.getKomgaConfig();