Skip to content

Set sync request to re-download books when the book file has changed#3394

Open
AsherMaximum wants to merge 16 commits intojaneczku:Developfrom
AsherMaximum:kobo-sync-changed-book-file
Open

Set sync request to re-download books when the book file has changed#3394
AsherMaximum wants to merge 16 commits intojaneczku:Developfrom
AsherMaximum:kobo-sync-changed-book-file

Conversation

@AsherMaximum
Copy link
Copy Markdown
Contributor

This is a continuation of PR #3381, and is dependent on changes from it, but I branched it off from my branch for that PR, separating it out since the functionality is for a pretty narrow use case, and the maintainers may not want to include this part.

This is for issue #3133.

When a sync is run, for any books that have any of the KOBO_FORMAT books with a file last modified date greater than the last sync, the sync request first sends a ChangedEntitlemet with Accessibility set to Preview. This causes the book download to be removed, but that isn't the purpose of it. The purpose is to make it so that with the next sync, when Accessibility is set to Full like normal, the Kobo sees it as a change, which causes a re-download.

So, after the ChangedEntitlement is sent, the book is removed from the kobo_synced_books table, and cont_sync is set to true, so that when Kobo process the request, it does another request to the sync page.

On that second call, since the book file is no longer modified after the last sync date, and the book is not in the kobo_synced_books table, it is sent as a NewEntitlement, which will trigger an automatic download of it - for the first 5 new books from a sync request as usual.

…itlement

Updating revision ID to let Kobo device know metadata has changed

Revert "Updating revision ID to let Kobo device know metadata has changed"

This reverts commit ec3367a.
This way when ChangedProductMetadata is sent, the coverImageId will be updated, and will trigger a redownload of the cover

Moving thumbnail generatedAt fetch to query in metadata function
…nitlement with Preview Accesibility

Checking book file modified date against sync_token to send ChangedEntitlement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant