Merge remote-tracking branch 'kobo/shelves' into Develop
This commit is contained in:
@@ -78,6 +78,7 @@ class SyncToken():
|
||||
"books_last_created": {"type": "string"},
|
||||
"archive_last_modified": {"type": "string"},
|
||||
"reading_state_last_modified": {"type": "string"},
|
||||
"tags_last_modified": {"type": "string"},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -88,13 +89,14 @@ class SyncToken():
|
||||
books_last_modified=datetime.min,
|
||||
archive_last_modified=datetime.min,
|
||||
reading_state_last_modified=datetime.min,
|
||||
tags_last_modified=datetime.min,
|
||||
):
|
||||
self.raw_kobo_store_token = raw_kobo_store_token
|
||||
self.books_last_created = books_last_created
|
||||
self.books_last_modified = books_last_modified
|
||||
self.archive_last_modified = archive_last_modified
|
||||
self.reading_state_last_modified = reading_state_last_modified
|
||||
|
||||
self.tags_last_modified = tags_last_modified
|
||||
|
||||
@staticmethod
|
||||
def from_headers(headers):
|
||||
@@ -128,6 +130,7 @@ class SyncToken():
|
||||
books_last_created = get_datetime_from_json(data_json, "books_last_created")
|
||||
archive_last_modified = get_datetime_from_json(data_json, "archive_last_modified")
|
||||
reading_state_last_modified = get_datetime_from_json(data_json, "reading_state_last_modified")
|
||||
tags_last_modified = get_datetime_from_json(data_json, "tags_last_modified")
|
||||
except TypeError:
|
||||
log.error("SyncToken timestamps don't parse to a datetime.")
|
||||
return SyncToken(raw_kobo_store_token=raw_kobo_store_token)
|
||||
@@ -137,7 +140,8 @@ class SyncToken():
|
||||
books_last_created=books_last_created,
|
||||
books_last_modified=books_last_modified,
|
||||
archive_last_modified=archive_last_modified,
|
||||
reading_state_last_modified=reading_state_last_modified
|
||||
reading_state_last_modified=reading_state_last_modified,
|
||||
tags_last_modified=tags_last_modified
|
||||
)
|
||||
|
||||
def set_kobo_store_header(self, store_headers):
|
||||
@@ -159,7 +163,8 @@ class SyncToken():
|
||||
"books_last_modified": to_epoch_timestamp(self.books_last_modified),
|
||||
"books_last_created": to_epoch_timestamp(self.books_last_created),
|
||||
"archive_last_modified": to_epoch_timestamp(self.archive_last_modified),
|
||||
"reading_state_last_modified": to_epoch_timestamp(self.reading_state_last_modified)
|
||||
"reading_state_last_modified": to_epoch_timestamp(self.reading_state_last_modified),
|
||||
"tags_last_modified": to_epoch_timestamp(self.tags_last_modified)
|
||||
},
|
||||
}
|
||||
return b64encode_json(token)
|
||||
|
||||
Reference in New Issue
Block a user