1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-11-15 14:37:37 +00:00

Code cosmetics

This commit is contained in:
Ozzieisaacs
2020-04-19 19:08:58 +02:00
parent 7bb5afa585
commit 24c743d23d
15 changed files with 262 additions and 192 deletions

View File

@@ -49,10 +49,11 @@ def get_datetime_from_json(json_object, field_name):
return datetime.min
class SyncToken():
class SyncToken:
""" The SyncToken is used to persist state accross requests.
When serialized over the response headers, the Kobo device will propagate the token onto following requests to the service.
As an example use-case, the SyncToken is used to detect books that have been added to the library since the last time the device synced to the server.
When serialized over the response headers, the Kobo device will propagate the token onto following
requests to the service. As an example use-case, the SyncToken is used to detect books that have been added
to the library since the last time the device synced to the server.
Attributes:
books_last_created: Datetime representing the newest book that the device knows about.
@@ -66,10 +67,11 @@ class SyncToken():
token_schema = {
"type": "object",
"properties": {"version": {"type": "string"}, "data": {"type": "object"},},
"properties": {"version": {"type": "string"}, "data": {"type": "object"}, },
}
# This Schema doesn't contain enough information to detect and propagate book deletions from Calibre to the device.
# A potential solution might be to keep a list of all known book uuids in the token, and look for any missing from the db.
# A potential solution might be to keep a list of all known book uuids in the token, and look for any missing
# from the db.
data_schema_v1 = {
"type": "object",
"properties": {