Skip to content

ResourceItem, EpubDoc::get_cover_id, EpubDoc::get_nav_id, EpubDoc::get_title#54

Merged
danigm merged 3 commits intodanigm:masterfrom
l1yefeng:master
May 27, 2025
Merged

ResourceItem, EpubDoc::get_cover_id, EpubDoc::get_nav_id, EpubDoc::get_title#54
danigm merged 3 commits intodanigm:masterfrom
l1yefeng:master

Conversation

@l1yefeng
Copy link
Copy Markdown
Contributor

Three commits are

  1. Use struct ResourceItem to replace tuple and stores (manifest) item properties. This enables the next point.
  2. Modified get_cover_id and added get_nav_id. Looking for the cover's ID in the method instead of when initializing (and storing in a field) is kind of a conversion to a lazy approach. It doesn't matter much but my real motivation was to delete this side-effect of setting self.cover_id from the metadata construction procedure.
  3. (Not closely related to the previous two.) The change of metadata's type makes getting the title (into a string) need more typing. Considering that is perhaps a very common task, get_title is provided conveniently.

l1yefeng added 3 commits May 26, 2025 18:01
Field `cover_id` is removed from `EpubDoc`. The value can be found by
the existing method `get_cover_id` (implementation modified).

A similar method `get_nav_id` is added.
Copy link
Copy Markdown
Owner

@danigm danigm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@danigm danigm merged commit 27eeef3 into danigm:master May 27, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants