Skip to content

personal instance changes, potentially useful to main repo#27

Open
aminamos wants to merge 3 commits intoplusuncold:masterfrom
aminamos:master
Open

personal instance changes, potentially useful to main repo#27
aminamos wants to merge 3 commits intoplusuncold:masterfrom
aminamos:master

Conversation

@aminamos
Copy link

This PR refines chapter presentation, file naming, and content extraction in the audiobook conversion pipeline. NOTE: this was heavily vibecoded several months ago, if any changes are requested or required, I'll probably start over entirely.

autiobooks.py

  • Chapter names in the UI now prefer display_name, with a fallback that humanizes raw filenames (underscore→space, title-case).
  • Progress messages use real chapter names rather than numeric placeholders.
  • Output WAV files adopt descriptive names (BookName_Introduction.wav), replacing the generic _chapter_1.wav pattern.
  • Chapter names are sanitized to safe characters (alphanumeric, space, underscore, hyphen) and trimmed to 50 characters.

engine.py

  • Introduces extract_chapter_content(), which preserves structural elements such as headings, lists, and special blocks.
  • Headings are normalized using Markdown prefixes; lists use bullet markers; epigraphs are labeled explicitly.
  • process_chapter() now unifies title extraction and content extraction.
  • TOC and navigation files are more reliably detected and omitted.
  • Faulty chapters are skipped safely via expanded try/except handling with error logging.

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