mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 05:40:26 +02:00
Fix book handler showing old cache when replace_single_newlines changed
This commit is contained in:
@@ -366,13 +366,18 @@ class HandlerDialog(QDialog):
|
||||
|
||||
def _preprocess_content(self):
|
||||
"""Pre-process content from the document"""
|
||||
# Create cache key from file path, modification time, and file type
|
||||
# Create cache key from file path, modification time, file type, and replace_single_newlines setting
|
||||
try:
|
||||
mod_time = os.path.getmtime(self.book_path)
|
||||
except Exception:
|
||||
mod_time = 0
|
||||
|
||||
cache_key = (self.book_path, mod_time, self.file_type)
|
||||
# Include replace_single_newlines in cache key since it affects text cleaning
|
||||
from abogen.utils import load_config
|
||||
cfg = load_config()
|
||||
replace_single_newlines = cfg.get("replace_single_newlines", False)
|
||||
|
||||
cache_key = (self.book_path, mod_time, self.file_type, replace_single_newlines)
|
||||
|
||||
# Check if content is already cached
|
||||
if cache_key in HandlerDialog._content_cache:
|
||||
|
||||
Reference in New Issue
Block a user