Delete books prepared for deleting on doogle drive

This commit is contained in:
OzzieIsaacs 2017-04-15 18:24:48 +02:00
parent 195e581aef
commit c80e517c28
2 changed files with 7 additions and 1 deletions

View File

@ -277,6 +277,9 @@ 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)
def delete_book_gdrive(book):
pass
def update_dir_stucture(book_id, calibrepath):
db.session.connection().connection.connection.create_function("title_sort", 1, db.title_sort)
book = db.session.query(db.Books).filter(db.Books.id == book_id).first()

View File

@ -1290,6 +1290,9 @@ def delete_book(book_id):
if current_user.role_delete_books():
book = db.session.query(db.Books).filter(db.Books.id == book_id).first()
if book:
if config.config_use_google_drive:
helper.delete_book_gdrive(book) # ToDo really delete file
else:
helper.delete_book(book,config.config_calibre_dir)
# check if only this book links to:
# author, language, series, tags, custom columns