Commit 2850a84b authored by OzzieIsaacs's avatar OzzieIsaacs

Fix for deleting books if book path contains no path (#432)

parent 07d6ba09
......@@ -307,9 +307,11 @@ def get_sorted_author(value):
def delete_book(book, calibrepath):
path = os.path.join(calibrepath, book.path) # .replace('/',os.path.sep)).replace('\\',os.path.sep)
shutil.rmtree(path, ignore_errors=True)
if "/" in book.path:
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
def delete_book_gdrive(book):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment