hect0x7 / hect0x7/JMComic-Crawler-Python
插件提案:给 Calibre 用户生成 metadata.opf
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.3k
- Forks
- 11.9k
- Avg merge
- 9h 35m
- Merged PRs (30d)
- 7
Description
平时用 Calibre 管理下载下来的本子,导入的时候书名、作者、标签、封面全都要手动补,很烦。看了一下插件列表,download_cover、favorite_folder_export、zip/img2pdf 这些都有了,但缺一个元数据导出的环节,所以想提个 calibre_metadata 插件。
想法是挂在 after_album 上,每个本子生成一份 metadata.opf(Calibre 认这个格式),封面可以复用 download_cover 的逻辑顺带存一份。这样 Calibre 导入时选"从 OPF 读元数据"就全补齐了。
配置大概是这个样子:
plugins:
after_album:
- plugin: calibre_metadata
kwargs:
dir_rule:
rule: "Bd/{Atitle}/metadata.opf"
base_dir: "./"
include_cover: true
language: "zh"
字段映射上有些细节想讨论:
- title 用
album.title,作者放 creators,author 为空时用DEFAULT_AUTHOR兜底(跟favorite_folder_export的行为保持一致) - tags 直接进 subject
- identifier 加一个
jmcomic:{album_id},这样 Calibre 里的书能反查回禁漫的 album_id,以后想增量更新或重新下载都方便
如果觉得这个方向值得做我就动手写,会带上测试。
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing after_album plugin implementations, especially download_cover and favorite_folder_export, and inspect the documented plugin configuration. Define how the calibre_metadata plugin writes metadata.opf, reuses cover handling, and maps the proposed fields and identifier. Done means the plugin is configurable as shown and includes tests for metadata generation and the DEFAULT_AUTHOR fallback.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100