1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-06-27 16:36:00 +00:00

Added integration for Readwise Reader

This commit is contained in:
Corey McCaffrey 2023-07-27 23:51:44 -04:00 committed by GitHub
parent 3aad650622
commit 3bac768cda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 178 additions and 3 deletions

View file

@ -140,6 +140,8 @@ func (s *Storage) Integration(userID int64) (*model.Integration, error) {
espial_url,
espial_api_key,
espial_tags,
readwise_enabled,
readwise_api_key,
pocket_enabled,
pocket_access_token,
pocket_consumer_key,
@ -194,6 +196,8 @@ func (s *Storage) Integration(userID int64) (*model.Integration, error) {
&integration.EspialURL,
&integration.EspialAPIKey,
&integration.EspialTags,
&integration.ReadwiseEnabled,
&integration.ReadwiseAPIKey,
&integration.PocketEnabled,
&integration.PocketAccessToken,
&integration.PocketConsumerKey,
@ -272,9 +276,11 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error {
matrix_bot_chat_id=$43,
notion_enabled=$44,
notion_token=$45,
notion_page_id=$46
notion_page_id=$46,
readwise_enabled=$47,
readwise_api_key=$48
WHERE
user_id=$47
user_id=$49
`
_, err := s.db.Exec(
query,
@ -324,6 +330,8 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error {
integration.NotionEnabled,
integration.NotionToken,
integration.NotionPageID,
integration.ReadwiseEnabled,
integration.ReadwiseAPIKey,
integration.UserID,
)
@ -344,7 +352,7 @@ func (s *Storage) HasSaveEntry(userID int64) (result bool) {
WHERE
user_id=$1
AND
(pinboard_enabled='t' OR instapaper_enabled='t' OR wallabag_enabled='t' OR notion_enabled='t' OR nunux_keeper_enabled='t' OR espial_enabled='t' OR pocket_enabled='t' OR linkding_enabled='t')
(pinboard_enabled='t' OR instapaper_enabled='t' OR wallabag_enabled='t' OR notion_enabled='t' OR nunux_keeper_enabled='t' OR espial_enabled='t' OR readwise_enabled='t' OR pocket_enabled='t' OR linkding_enabled='t')
`
if err := s.db.QueryRow(query, userID).Scan(&result); err != nil {
result = false