1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-11-02 00:03:03 +00:00

More fixes for googledrive

This commit is contained in:
Ozzieisaacs
2019-12-14 22:22:27 +01:00
parent e308a74dc2
commit 86fe970651
3 changed files with 15 additions and 2 deletions

View File

@@ -23,6 +23,7 @@
from __future__ import division, print_function, unicode_literals
import os
import sys
import hashlib
import json
import tempfile
@@ -141,7 +142,10 @@ def on_received_watch_confirmation():
response = gdriveutils.getChangeById(gdriveutils.Gdrive.Instance().drive, j['id'])
log.debug('%r', response)
if response:
dbpath = os.path.join(config.config_calibre_dir, "metadata.db")
if sys.version_info < (3, 0):
dbpath = os.path.join(config.config_calibre_dir, "metadata.db")
else:
dbpath = os.path.join(config.config_calibre_dir, "metadata.db").encode()
if not response['deleted'] and response['file']['title'] == 'metadata.db' and response['file']['md5Checksum'] != hashlib.md5(dbpath):
tmpDir = tempfile.gettempdir()
log.info('Database file updated')