File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -303,7 +303,7 @@ Copyright (C) 2024-2025 Calibre-Web Automated contributors
303303- zhiyue (1 commits)
304304# Fork Contributors (crocodilestick/calibre-web-automated)
305305
306- - crocodilestick (778 commits)
306+ - crocodilestick (780 commits)
307307- jmarmstrong1207 (73 commits)
308308- demitrix (30 commits)
309309- sirwolfgang (29 commits)
Original file line number Diff line number Diff line change @@ -86,10 +86,16 @@ def execute_sql(sql):
8686 try :
8787 db_list = execute_sql ("PRAGMA database_list" ).fetchall ()
8888 # Row format: (seq, name, file)
89+ # Log the database list for debugging
90+ log .info (f"Database list: { [str (row ) for row in db_list ]} " )
8991 is_calibre_attached = any (str (row [1 ]) == 'calibre' for row in db_list )
90- except Exception :
92+ except Exception as e :
93+ log .warning (f"Failed to check database list: { e } " )
9194 is_calibre_attached = False
9295
96+ if not is_calibre_attached :
97+ log .warning ("Calibre database not attached. Creating table in main schema (in-memory?). This may cause persistence issues." )
98+
9399 table_prefix = "calibre." if is_calibre_attached else ""
94100 table_name = f"{ table_prefix } book_format_checksums"
95101 master_table = f"{ table_prefix } sqlite_master"
Original file line number Diff line number Diff line change @@ -242,11 +242,18 @@ def gdrive_sync_if_enabled():
242242 print (f"[ingest-processor] WARN: Could not ensure processed_books directories: { e } " , flush = True )
243243
244244# Generates dictionary of available backup directories and their paths
245- backup_destinations = {
246- entry .name : entry .path
247- for entry in os .scandir ("/config/processed_books" )
248- if entry .is_dir ()
249- }
245+ try :
246+ backup_destinations = {
247+ entry .name : entry .path
248+ for entry in os .scandir ("/config/processed_books" )
249+ if entry .is_dir ()
250+ }
251+ except FileNotFoundError :
252+ # Fallback for test environments where /config might not exist
253+ backup_destinations = {}
254+ except Exception as e :
255+ print (f"[ingest-processor] WARN: Could not scan processed_books: { e } " , flush = True )
256+ backup_destinations = {}
250257
251258class NewBookProcessor :
252259 def __init__ (self , filepath : str ):
You can’t perform that action at this time.
0 commit comments