mirror of
https://github.com/Aminark/legado-ios.git
synced 2026-10-24 21:01:22 +08:00
feat: 支持 EPUB 阅读并改善规则兼容与阅读稳定性
支持 EPUB 2/3 导入、目录、封面和章节插图,保留本地书管理与阅读进度。 修复 JSON 模板、动态替换与请求参数兼容,以及 RSS 翻页和连续滚动定位。 更新编辑器工具栏和回归测试,发布版本为 0.1.12(build 18)。
This commit is contained in:
@@ -52,6 +52,7 @@ struct LegadoApp: App {
|
||||
await bookLibrary.load()
|
||||
await replaceRuleLibrary.load()
|
||||
await readingActivity.load()
|
||||
await rssLibrary.load()
|
||||
await ruleSubscriptions.load()
|
||||
if UserDefaults.standard.bool(forKey: "auto_refresh") {
|
||||
await bookLibrary.checkForUpdates(sources: sourceLibrary.sources, onlyRead: UserDefaults.standard.bool(forKey: "onlyUpdateRead"))
|
||||
@@ -60,6 +61,15 @@ struct LegadoApp: App {
|
||||
}
|
||||
.onOpenURL { url in
|
||||
Task {
|
||||
if url.isFileURL && url.pathExtension.lowercased() == "epub" {
|
||||
let file = LocalBookImportFile(url: url)
|
||||
await bookLibrary.load()
|
||||
await bookLibrary.importPickedLocalFiles([file])
|
||||
sourceLibrary.notice = .init(kind: bookLibrary.errorMessage == nil ? .success : .error,
|
||||
title: bookLibrary.errorMessage == nil ? "EPUB 已加入书架" : "导入失败",
|
||||
detail: bookLibrary.errorMessage ?? url.lastPathComponent)
|
||||
return
|
||||
}
|
||||
await sourceLibrary.load()
|
||||
if url.scheme?.lowercased() == "legado", url.path.lowercased() == "/replacerule" {
|
||||
await replaceRuleLibrary.load()
|
||||
|
||||
Reference in New Issue
Block a user