mirror of
https://github.com/Aminark/legado-ios.git
synced 2026-10-23 12:21:23 +08:00
fix: 修复书源导入、阅读外观和书签状态
- 修复书源文件选择、访问权限与导入预览流程,支持查看分组内的书源 - 修复背景图片、字体选择与主题切换,限制背景图片解码尺寸 - 根据已保存书签恢复当前位置状态,避免重复添加 - 补充模型、阅读器和文件选择回归测试及测试样本 - 更新应用版本为 0.1.10(build 16) Fixes #1
This commit is contained in:
@@ -59,6 +59,18 @@ final class ReaderViewModel: ObservableObject {
|
||||
private var sourceCacheNeedsInvalidation = false
|
||||
private var pendingSourceContent: ChapterContentReport?
|
||||
|
||||
func bookmarks(at position: Int, in bookmarks: [Bookmark], pageRange: NSRange? = nil) -> [Bookmark] {
|
||||
bookmarks.filter { bookmark in
|
||||
guard bookmark.bookName == book.name, bookmark.bookAuthor == book.author,
|
||||
bookmark.resolvedChapterIndex(in: chapters) == currentIndex else { return false }
|
||||
if bookmark.chapterPosition == max(position, 0) { return true }
|
||||
if let pageRange, pageRange.length > 0 {
|
||||
return NSLocationInRange(bookmark.chapterPosition, pageRange)
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func prepareContinuousReading(rules: [ReplaceRule]) async {
|
||||
guard hasLoadedCurrentChapter else { return }
|
||||
if scrollChapters.isEmpty {
|
||||
|
||||
Reference in New Issue
Block a user