Bugfix gdrive

Still open: gdrive.db entries aren't cleared upon change, gdrive.db is only working after restart if just enabled
pull/550/head
OzzieIsaacs 6 years ago
parent 404b29b979
commit 413b10c58e

@ -307,6 +307,7 @@ def get_sorted_author(value):
def delete_book(book, calibrepath): def delete_book(book, calibrepath):
# check that path is 2 elements deep, check that target path has no subfolders
if "/" in book.path: if "/" in book.path:
path = os.path.join(calibrepath, book.path) path = os.path.join(calibrepath, book.path)
shutil.rmtree(path, ignore_errors=True) shutil.rmtree(path, ignore_errors=True)
@ -315,6 +316,10 @@ def delete_book(book, calibrepath):
# ToDo: Implement delete book on gdrive # ToDo: Implement delete book on gdrive
def delete_book_gdrive(book): def delete_book_gdrive(book):
# delete book and path of book in gdrive.db
# delete book and path of book on gdrive
#gFile = gd.getFileFromEbooksFolder(web.Gdrive.Instance().drive, os.path.dirname(book.path), titledir)
#gFile.Trash()
pass pass
@ -366,7 +371,7 @@ def update_dir_structure_gdrive(book_id):
new_titledir = get_valid_filename(book.title) + " (" + str(book_id) + ")" new_titledir = get_valid_filename(book.title) + " (" + str(book_id) + ")"
if titledir != new_titledir: if titledir != new_titledir:
print (titledir) # print (titledir)
gFile = gd.getFileFromEbooksFolder(web.Gdrive.Instance().drive, os.path.dirname(book.path), titledir) gFile = gd.getFileFromEbooksFolder(web.Gdrive.Instance().drive, os.path.dirname(book.path), titledir)
gFile['title'] = new_titledir gFile['title'] = new_titledir
gFile.Upload() gFile.Upload()

@ -2538,8 +2538,7 @@ def configuration_helper(origin):
gdrive=gdrive_support, gdriveError=gdriveError, gdrive=gdrive_support, gdriveError=gdriveError,
goodreads=goodreads_support, title=_(u"Basic Configuration")) goodreads=goodreads_support, title=_(u"Basic Configuration"))
# always show google drive settings, but in case of error deny support # always show google drive settings, but in case of error deny support
if (("config_use_google_drive" in to_save and not content.config_use_google_drive) or if "config_use_google_drive" in to_save and not gdriveError:
("config_use_google_drive" not in to_save and content.config_use_google_drive)) and not gdriveError:
content.config_use_google_drive = "config_use_google_drive" in to_save content.config_use_google_drive = "config_use_google_drive" in to_save
else: else:
content.config_use_google_drive = 0 content.config_use_google_drive = 0

Loading…
Cancel
Save