yihong0618 / bilingual_book_maker

Make bilingual epub books Using AI translate
MIT License
7.33k stars 1.05k forks source link

fix: bugs for using exlude_filelists and only_filelists #324

Closed zerone01y closed 1 year ago

zerone01y commented 1 year ago

Two bugs are found when using the exlude_filelist and only_filelist options:

  1. progress bars: currently the progress bar adds up the tags for all files in an epub; after the commit it only counts tags in files that will be included.
  2. temp file that only translate a subset of files will lead to a mismatch between translated texts and original texts. The commit fixes the bug.
zerone01y commented 1 year ago

Hey, I notice another potential issue with the "only_filelist" behavior, since it removes files not listed, but doesn't adapt the toc/nav/spine, etc. This can lead to broken references and unusable EPUBS in many readers (e.g. ibook).

To generate functional EPUB, you may want to considering having "only_filelist" act more like "exclude_filelist", where untranslated files are included in the book even if not listed. Let me know if you agree with this. If so, I can submit a quick commit in this pull request.

yihong0618 commented 1 year ago

Thanks