mirror of
https://github.com/JonathanHerrewijnen/calibre-web.git
synced 2024-11-13 14:44:20 +00:00
Fix for deleting books if book path contains no path (#432)
This commit is contained in:
parent
07d6ba094b
commit
2850a84bbc
@ -307,9 +307,11 @@ def get_sorted_author(value):
|
|||||||
|
|
||||||
|
|
||||||
def delete_book(book, calibrepath):
|
def delete_book(book, calibrepath):
|
||||||
path = os.path.join(calibrepath, book.path) # .replace('/',os.path.sep)).replace('\\',os.path.sep)
|
if "/" in book.path:
|
||||||
shutil.rmtree(path, ignore_errors=True)
|
path = os.path.join(calibrepath, book.path)
|
||||||
|
shutil.rmtree(path, ignore_errors=True)
|
||||||
|
else:
|
||||||
|
logging.getLogger('cps.web').error("Deleting book " + str(book.id) + " failed, book path value: "+ book.path)
|
||||||
|
|
||||||
# ToDo: Implement delete book on gdrive
|
# ToDo: Implement delete book on gdrive
|
||||||
def delete_book_gdrive(book):
|
def delete_book_gdrive(book):
|
||||||
|
Loading…
Reference in New Issue
Block a user