Bugfixes for uploading books to GDrive with new worker

pull/1539/merge
OzzieIsaacs 4 years ago
parent b202ca5619
commit e29247774c

@ -848,7 +848,7 @@ def upload():
book_id = db_book.id book_id = db_book.id
title = db_book.title title = db_book.title
error = helper.update_dir_stucture(book_id, error = helper.update_dir_structure_file(book_id,
config.config_calibre_dir, config.config_calibre_dir,
input_authors[0], input_authors[0],
meta.file_path, meta.file_path,
@ -872,10 +872,7 @@ def upload():
# save data to database, reread data # save data to database, reread data
calibre_db.session.commit() calibre_db.session.commit()
#calibre_db.setup_db(config, ub.app_DB_path)
# Reread book. It's important not to filter the result, as it could have language which hide it from
# current users view (tags are not stored/extracted from metadata and could also be limited)
#book = calibre_db.get_book(book_id)
if config.config_use_google_drive: if config.config_use_google_drive:
gdriveutils.updateGdriveCalibreFromLocal() gdriveutils.updateGdriveCalibreFromLocal()
if error: if error:

@ -243,7 +243,7 @@ def getEbooksFolderId(drive=None):
gDriveId.path = '/' gDriveId.path = '/'
session.merge(gDriveId) session.merge(gDriveId)
session.commit() session.commit()
return return gDriveId.gdrive_id
def getFile(pathId, fileName, drive): def getFile(pathId, fileName, drive):

@ -414,7 +414,7 @@ def update_dir_structure_file(book_id, calibrepath, first_author, orignal_filepa
src=new_path, dest=new_name, error=str(ex)) src=new_path, dest=new_name, error=str(ex))
return False return False
def update_dir_structure_gdrive(book_id, first_author, original_filepath): def update_dir_structure_gdrive(book_id, first_author):
error = False error = False
book = calibre_db.get_book(book_id) book = calibre_db.get_book(book_id)
path = book.path path = book.path
@ -518,7 +518,7 @@ def uniq(inpt):
def update_dir_stucture(book_id, calibrepath, first_author=None, orignal_filepath=None, db_filename=None): def update_dir_stucture(book_id, calibrepath, first_author=None, orignal_filepath=None, db_filename=None):
if config.config_use_google_drive: if config.config_use_google_drive:
return update_dir_structure_gdrive(book_id, first_author, orignal_filepath, db_filename) return update_dir_structure_gdrive(book_id, first_author)
else: else:
return update_dir_structure_file(book_id, calibrepath, first_author, orignal_filepath, db_filename) return update_dir_structure_file(book_id, calibrepath, first_author, orignal_filepath, db_filename)

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save