Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better update ergonomics #13

Open
buckley-w-david opened this issue Nov 24, 2021 · 1 comment
Open

Better update ergonomics #13

buckley-w-david opened this issue Nov 24, 2021 · 1 comment

Comments

@buckley-w-david
Copy link
Owner

When a book is updated, the reading progress is wiped out.

This is likely due to the implementation of updateDocument I wrote for plato as opposed to anything with plato-calibre

I should attempt to keep reading progress. There is an awkward situation where the number of chapters after an update can actually go down if a story removes a bunch of chapters (Like they have to after cutting a book for kindle unlimited). This means we probably can't do something as simple as copying over the previous reading progress and expecting it to work. Might be best to just try that and if it's past the end of the book reset to the start.

@buckley-w-david
Copy link
Owner Author

Looked into this a bit more.

This information is stored in the reader field of the info struct, which is sent to us from the search.

Unfortunately even if we extract it from the search results and pass it on with our update, it won't work.

pub struct Info {
    ....
    #[serde(skip)]
    pub reader: Option<ReaderInfo>,
    #[serde(skip_serializing_if = "Option::is_none", skip_deserializing)]
    pub _reader: Option<ReaderInfo>,
    ...
}

_reader or reader is what we'd be targeting, not sure which, but regardless neither of them are set to deserialize, so even if we pass the info along it will just be thrown away.

I'd have to start mucking about with the info definition to get it to work, and that's getting farther into the internals of plato than I wanted to change.

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

No branches or pull requests

1 participant