baskerville / plato

Document reader
Other
1.25k stars 103 forks source link

[Feature request] Star wallabag articles from Plato #318

Closed xvello closed 11 months ago

xvello commented 12 months ago

Hello @baskerville and thank you for this great project!

The Wallabag integration is really neat, and is allowing me to go through a pretty big backlog of saved articles. The one thing I'm currently missing is the ability to star articles after I finish them. I'm planning on opening a PR for this, but want to discuss the implementation design with you first.

Here's my suggested plan, I'd love your input in whether that's the best way forward or whether we should implement it differently:

Add a starred field to ReaderInfo

Showing the starred status in the library list / filtering by starred status would be out of scope for this PR, but possible later.

Fetcher passes starred status on archival

When iterating over finished articles, the fetch will pass the value of _reader.starred as the starred argument to the Wallabag PATCH request. This assumes that the fetcher is able to access the _reader field, as the Event::FetcherSearch handler code suggests.

To allow us to ship at this point without part three, the fetcher can default to only adding stars, and don't remove the star if it's present in Wallabag and not Plato. This conservative mode can be preferred by some users, as both states won't be in perfect sync (see last section). Changing an option will allow fetcher to remove stars too, making the Plato state canonical.

Fetcher passes starred status on new article import

The Wallabag list API does return the starred status so we can import it into the library, to avoid overwriting it to false when archiving the article later. Either:

Out of scope: finer sync granularity for the starred status

Some users might want to update the starred status outside of the existing "get new article" and "archive finished article" flows. This is possible by expanding the fetcher's logic, but I'd rather leave this out of scope for now, and address it in other PRs.

xvello commented 12 months ago

Well, I got carried away and implemented the first two parts in https://github.com/baskerville/plato/pull/319, cross-compiled both binaries and am currently running them on my Libra 2. Waiting on your feedback on that PR and the issue before I implement part three (sync stars from Wallabag, unstar on archive).

xvello commented 11 months ago

Closing as of https://github.com/baskerville/plato/pull/319#issuecomment-1732619051