feat: Legado 备份导入 & WebDAV 阅读进度同步#2
Open
aimercat1994 wants to merge 2 commits into
Open
Conversation
## Legado Backup Import
- Parse Legado App WebDAV backup .zip files and import into reader-next
- Supports: books, book sources, book groups, bookmarks, replace rules, RSS sources
- Auto-filters content:// local files, decodes data: URI inline books
- Sorts imported books by reading progress (chapter index > position > time)
- Preview modal shows import summary before confirming
## WebDAV Reading Progress Sync
- Legado-compatible progress format: /legado/bookProgress/{name}_{author}.json
- Auto-pull: syncs progress from WebDAV on bookshelf load (chapter index wins)
- Auto-push: writes progress to WebDAV on each chapter save (fire-and-forget)
- Manual sync: pull/push buttons in backup manager UI
## Files Changed
- frontend/src/utils/legadoImport.ts (new)
- frontend/src/utils/webdavSync.ts (new)
- frontend/src/utils/legadoImport.test.ts (new, 15 tests)
- frontend/src/components/WebdavManager.vue (modified)
- frontend/src/stores/bookshelf.ts (modified)
- frontend/src/stores/reader.ts (modified)
- frontend/package.json (added jszip dependency)
- Filter out data: URI decoded books with empty bookUrl to prevent 'bookUrl required' error from saveBooks API - Revert import sort to use durChapterTime (last read time) instead of chapter index, which is more meaningful for shelf display order - Update tests to match new sort behavior
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Legado 备份导入
解析 Legado App 的 WebDAV 备份
.zip文件,转换为 reader-next 原生格式并导入:content://手机本地文件,解码data:内联书籍WebDAV 阅读进度同步
实现 Legado 兼容的 WebDAV 阅读进度同步,格式:
/legado/bookProgress/{书名}_{作者}.json文件变更
frontend/src/utils/legadoImport.tsfrontend/src/utils/webdavSync.tsfrontend/src/utils/legadoImport.test.tsfrontend/src/components/WebdavManager.vuefrontend/src/stores/bookshelf.tsfrontend/src/stores/reader.tsfrontend/package.jsonjszip依赖测试