Skip to content

Commit 69538b8

Browse files
committed
Switch from is to == for literals.
Add print line to investigate kosync import error
1 parent 7af9cf6 commit 69538b8

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

root/app/calibre-web/cps/main.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@ def main():
6262
try:
6363
from .kosync import kosync, populate_document_hashes
6464
populate_document_hashes()
65-
except:
66-
kosync = None
65+
except ImportError as e:
66+
# Debugging for xytronix
67+
print("KOSync import error:",e)
68+
kosync_available = False
6769
from . import web_server
6870
init_errorhandler()
6971

@@ -76,7 +78,8 @@ def main():
7678
app.register_blueprint(cwa_check_status)
7779
app.register_blueprint(cwa_settings)
7880
app.register_blueprint(cwa_logs)
79-
app.register_blueprint(kosync)
81+
if kosync_available:
82+
app.register_blueprint(kosync)
8083

8184
# Stock CW
8285
app.register_blueprint(search)

root/app/calibre-web/cps/services/hardcover.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ def update_reading_progress(self, identifiers, progress_percent):
142142
"pages": pages_read,
143143
"editionId": int(book.get("edition").get("id")),
144144
"startedAt":read.get("started_at",datetime.now().strftime("%Y-%m-%d")),
145-
"finishedAt": datetime.now().strftime("%Y-%m-%d") if progress_percent is 100 else None
145+
"finishedAt": datetime.now().strftime("%Y-%m-%d") if progress_percent == 100 else None
146146
}
147-
if progress_percent is 100:
147+
if progress_percent == 100:
148148
self.change_book_status(book, 3)
149149
self.execute(query=mutation, variables=variables)
150150
return

0 commit comments

Comments
 (0)