优化 EPUB 翻页与后台分页刷新
This commit is contained in:
@@ -191,12 +191,21 @@ final class RDEPUBReaderPaginationCoordinator {
|
||||
runtime: runtime,
|
||||
layoutSnapshot: layoutSnapshot
|
||||
)
|
||||
RDEPUBBackgroundTrace.log(
|
||||
"Pagination",
|
||||
"anchorChapterReady spine=\(runtimeChapter.spineIndex) pages=\(runtimeChapter.pages.count)"
|
||||
)
|
||||
let initialChapters = self.loadInitialInteractiveRuntimeChapters(
|
||||
anchorChapter: runtimeChapter,
|
||||
publication: publication,
|
||||
runtime: runtime,
|
||||
layoutSnapshot: layoutSnapshot
|
||||
)
|
||||
let initialPageCount = initialChapters.reduce(0) { $0 + $1.pages.count }
|
||||
RDEPUBBackgroundTrace.log(
|
||||
"Pagination",
|
||||
"initialInteractiveChapters ready count=\(initialChapters.count) pages=\(initialPageCount) spines=\(initialChapters.map(\.spineIndex))"
|
||||
)
|
||||
|
||||
DispatchQueue.main.async {
|
||||
guard context.paginationToken == token,
|
||||
@@ -220,9 +229,17 @@ final class RDEPUBReaderPaginationCoordinator {
|
||||
parser: parser,
|
||||
publication: publication
|
||||
)
|
||||
RDEPUBBackgroundTrace.log(
|
||||
"Pagination",
|
||||
"startingMetadataWorker token=\(token.uuidString) anchorSpine=\(runtimeChapter.spineIndex) partialPages=\(partialMap.totalPages) partialChapters=\(partialMap.totalChapters)"
|
||||
)
|
||||
worker.start(token: token, restoreLocation: restoreLocation)
|
||||
}
|
||||
} catch {
|
||||
RDEPUBBackgroundTrace.log(
|
||||
"Pagination",
|
||||
"initialPaginationFailed error=\(String(describing: error)) prioritizedCandidates=\(prioritizedCandidates)"
|
||||
)
|
||||
DispatchQueue.main.async {
|
||||
guard context.paginationToken == token,
|
||||
context.controller != nil else { return }
|
||||
|
||||
Reference in New Issue
Block a user