mirror of
https://github.com/janeczku/calibre-web
synced 2025-10-13 14:47:40 +00:00
Fix deletion of books with multiple custom column links
Fix delete of author-folder in case last book of author was deleted (#1269)
This commit is contained in:
@@ -283,6 +283,9 @@ def delete_book_file(book, calibrepath, book_format=None):
|
||||
log.error("Deleting book %s failed, path has subfolders: %s", book.id, book.path)
|
||||
return False
|
||||
shutil.rmtree(path, ignore_errors=True)
|
||||
authorpath = os.path.join(calibrepath, os.path.split(book.path)[0])
|
||||
if not os.listdir(authorpath):
|
||||
shutil.rmtree(authorpath, ignore_errors=True)
|
||||
return True
|
||||
else:
|
||||
log.error("Deleting book %s failed, book path not valid: %s", book.id, book.path)
|
||||
|
Reference in New Issue
Block a user