Skip to content

Add refresh-ebible-licenses command to update translation licenses - #84

Merged
KallynGowdy merged 1 commit into
mainfrom
claude/tender-shannon-3264yt
Oct 12, 2026
Merged

KallynGowdy merged 1 commit into
mainfrom
claude/tender-shannon-3264yt

Conversation

@KallynGowdy

Copy link
Copy Markdown
Collaborator

Summary

This PR adds a new CLI command refresh-ebible-licenses that 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

  • New 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.
  • New ebibleIdFromUrl() utility function: Extracts eBible translation IDs from ebible.org details page URLs, with proper validation of hostname and pathname.
  • New updateMetadataLicenses() helper function: Updates metadata.json files in a source translations directory to preserve detected licenses when translations are re-imported.
  • New CLI command: refresh-ebible-licenses [translations...] with optional --dir flag to also update metadata files.
  • Imports: Added License type import from generation tools and ebibleIdFromUrl export from ebible-license module.
  • Tests: Added comprehensive test cases for ebibleIdFromUrl() covering various URL formats and edge cases.

Implementation Details

  • The function identifies eBible translations by extracting their IDs from stored licenseUrl or website fields
  • Falls back to stored copyright text from the database if fetching current eBible metadata fails
  • Provides progress logging during license detection
  • Optionally updates metadata.json files in the source directory to preserve licenses across re-imports
  • Includes proper error handling and user warnings for translations that cannot be identified as eBible sources

https://claude.ai/code/session_01J6JNmbUF6TG2EarbCRrP3V

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
@KallynGowdy
KallynGowdy merged commit 15f85fd into main Oct 12, 2026
3 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