feat: enhance book addition logic to support local file saving or localforage storage

This commit is contained in:
troyeguo
2026-06-08 18:03:37 +08:00
parent 54e7ed29fb
commit d2f5f09b65

View File

@@ -404,7 +404,11 @@ class BookUtil {
if (!bookBuffer) {
return false;
}
await this.addBook(key, format, bookBuffer);
if (ConfigService.getReaderConfig("isUseLocal") === "yes") {
await LocalFileManager.saveFile(key + "." + format, bookBuffer, "book");
} else {
await localforage.setItem(key, bookBuffer);
}
toast.dismiss("add-book");
return true;
}