Skip to content

feat: improve metadata handling#134

Open
chief-hogger wants to merge 1 commit intoMiniGlome:mainfrom
chief-hogger:main
Open

feat: improve metadata handling#134
chief-hogger wants to merge 1 commit intoMiniGlome:mainfrom
chief-hogger:main

Conversation

@chief-hogger
Copy link

This PR improves the handling of metadata by addressing several limitations and inefficiencies in the current implementation:

  1. Fixed the -m/--meta option to work independently of -j. Previously, metadata JSON files were written to a temporary directory that would be deleted unless -j was specified. Now metadata files are always preserved in the output directory.

  2. Added a new -M/--meta-only option 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.

  3. 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:

  • Allowing metadata to be preserved regardless of other options
  • Providing a fast, metadata-only mode for cataloging purposes
  • Reducing unnecessary API calls to Archive.org's servers
  • Making the behavior more intuitive and user-friendly

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.

- 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
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.

1 participant