Skip to content

Commit 8d551a3

Browse files
committed
Working version of first commit
1 parent 7175c0e commit 8d551a3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

scripts/ingest_processor.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,9 @@ def convert_to_kepub(self) -> tuple[bool,str]:
168168
def delete_current_file(self) -> None:
169169
"""Deletes file just processed from ingest folder"""
170170
os.remove(self.filepath) # Removes processed file
171-
if os.path.dirname(self.filepath) != self.ingest_folder: # File was in ingest_folder, no directories to delete
171+
if not os.path.samefile(os.path.dirname(self.filepath),self.ingest_folder): # File not in ingest_folder, subdirectories to delete
172172
subprocess.run(["find", f"{os.path.dirname(self.filepath)}", "-type", "d", "-empty", "-delete"]) # Removes any now empty folders including parent directory
173173

174-
175174
def add_book_to_library(self, book_path:str) -> None:
176175
if self.target_format == "epub" and self.is_kindle_epub_fixer:
177176
self.run_kindle_epub_fixer(book_path, dest=self.tmp_conversion_dir)

0 commit comments

Comments
 (0)