feat: 支持 EPUB 阅读并改善规则兼容与阅读稳定性

支持 EPUB 2/3 导入、目录、封面和章节插图,保留本地书管理与阅读进度。
修复 JSON 模板、动态替换与请求参数兼容,以及 RSS 翻页和连续滚动定位。
更新编辑器工具栏和回归测试,发布版本为 0.1.12(build 18)。
This commit is contained in:
Aminark
2026-10-24 00:58:11 +08:00
parent 3322fd71db
commit 67bc212ffd
58 changed files with 2331 additions and 244 deletions
@@ -393,6 +393,20 @@ struct LegadoDatabaseTests {
#expect(report.result.nextURL == "https://rss.example/list?page=1")
}
@Test func rssJSONListWithoutWildcardExtractsIndividualArticles() async throws {
var source = RssSource(sourceUrl: "https://rss.example", sourceName: "JSON 订阅")
source.ruleArticles = "$.items"
source.ruleTitle = "$.title"
source.ruleLink = "$.link"
let report = try await RSSRuleParser().parse(
sortName: "全部", sortURL: "https://rss.example/feed", redirectURL: "https://rss.example/feed",
body: #"{"items":[{"title":"第一篇","link":"/one"},{"title":"第二篇","link":"/two"}]}"#,
source: source
)
#expect(report.result.articles.map(\.title) == ["第一篇", "第二篇"])
#expect(report.result.articles.map(\.link) == ["https://rss.example/one", "https://rss.example/two"])
}
@Test func rssSourceImporterSupportsObjectArrayManifestAndUpdateSelection() throws {
let importer = RSSSourceImporter()
let object = try importer.decode(Data(#"{"sourceUrl":"https://one","sourceName":"一"}"#.utf8))