@@ -51,14 +51,13 @@ def __init__(self, book_dir: str, file_path: str):
5151 self .book_title , self .author_name , self .title_author = self .get_title_and_author ()
5252
5353 self .calibre_env = os .environ .copy ()
54+ # Enables Calibre plugins to be used from /config/plugins
55+ self .calibre_env ["HOME" ] = "/config"
5456 # Gets split library info from app.db and sets library dir to the split dir if split library is enabled
5557 self .split_library = self .get_split_library ()
5658 if self .split_library :
5759 self .calibre_library = self .split_library ["split_path" ]
58- my_env = os .environ .copy ()
59- my_env ['CALIBRE_OVERRIDE_DATABASE_PATH' ] = os .path .join (self .split_library ["db_path" ], "metadata.db" )
60- self .calibre_env = my_env
61- print (f"[Book] - DEBUG - { my_env ['CALIBRE_OVERRIDE_DATABASE_PATH' ]} " )
60+ self .calibre_env ['CALIBRE_OVERRIDE_DATABASE_PATH' ] = os .path .join (self .split_library ["db_path" ], "metadata.db" )
6261
6362 self .cover_path = book_dir + '/cover.jpg'
6463 self .old_metadata_path = book_dir + '/metadata.opf'
@@ -141,14 +140,13 @@ def __init__(self, args):
141140 self .illegal_characters = ["<" , ">" , ":" , '"' , "/" , "\\ " , "|" , "?" , "*" ]
142141
143142 self .calibre_env = os .environ .copy ()
143+ # Enables Calibre plugins to be used from /config/plugins
144+ self .calibre_env ["HOME" ] = "/config"
144145 # Gets split library info from app.db and sets library dir to the split dir if split library is enabled
145146 self .split_library = self .get_split_library ()
146147 if self .split_library :
147148 self .calibre_library = self .split_library ["split_path" ]
148- my_env = os .environ .copy ()
149- my_env ['CALIBRE_OVERRIDE_DATABASE_PATH' ] = os .path .join (self .split_library ["db_path" ], "metadata.db" )
150- self .calibre_env = my_env
151- print (f"[enforcer] - DEBUG - { my_env ['CALIBRE_OVERRIDE_DATABASE_PATH' ]} " )
149+ self .calibre_env ['CALIBRE_OVERRIDE_DATABASE_PATH' ] = os .path .join (self .split_library ["db_path" ], "metadata.db" )
152150
153151
154152 def get_split_library (self ) -> dict [str , str ] | None :
0 commit comments