Repository navigation
Add refresh-ebible-licenses command to update translation licenses - #84
Merged
Merged
Conversation
Adds a CLI command that detects the licenses of the eBible translations already in a database and writes them to the Translation.license column, so existing databases can pick up license information without re-downloading and re-importing every translation. eBible translations are found by their ebible.org details page URL (licenseUrl or website), which also covers translations that use override metadata. Translations whose license can't be detected are left unchanged. The optional --dir flag also writes the detected licenses into the matching metadata.json files so a later re-import doesn't clear them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J6JNmbUF6TG2EarbCRrP3V
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.
Summary
This PR adds a new CLI command
refresh-ebible-licensesthat detects and updates the licenses of eBible translations already stored in the database without requiring a full re-import. It also includes a utility function to extract eBible translation IDs from URLs.Key Changes
refreshEBibleLicenses()function: Detects licenses for eBible translations in the database by querying their details pages and updates the database records. Supports optional filtering by translation IDs.ebibleIdFromUrl()utility function: Extracts eBible translation IDs from ebible.org details page URLs, with proper validation of hostname and pathname.updateMetadataLicenses()helper function: Updates metadata.json files in a source translations directory to preserve detected licenses when translations are re-imported.refresh-ebible-licenses [translations...]with optional--dirflag to also update metadata files.Licensetype import from generation tools andebibleIdFromUrlexport from ebible-license module.ebibleIdFromUrl()covering various URL formats and edge cases.Implementation Details
licenseUrlorwebsitefieldshttps://claude.ai/code/session_01J6JNmbUF6TG2EarbCRrP3V