Open
Conversation
- Fix -m/--meta option to preserve JSON file without requiring -j - Add -M/--meta-only option to download only metadata - Optimize loan/return operations to skip when only retrieving metadata
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.
This PR improves the handling of metadata by addressing several limitations and inefficiencies in the current implementation:
Fixed the
-m/--metaoption to work independently of-j. Previously, metadata JSON files were written to a temporary directory that would be deleted unless-jwas specified. Now metadata files are always preserved in the output directory.Added a new
-M/--meta-onlyoption that allows downloading just the metadata JSON without retrieving images or creating PDFs. This is useful for users who want to quickly catalog or inspect book metadata without downloading the full content, or who have downloaded a book previously but want to now download the metadata as well without having to fetch the whole book again.Optimized the loan/return operations by skipping them when only retrieving metadata. Previously, the script would unnecessarily borrow and return books even when just accessing metadata, which is freely available without a loan. This reduces API calls and improves efficiency.
These changes make the script more flexible and efficient by:
The changes maintain backward compatibility while adding new functionality that users may find valuable for various use cases.
Please feel free to offer any feedback if these new features require additional refinement or tweaking.