mirror of
https://github.com/miniflux/v2.git
synced 2025-07-02 16:38:37 +00:00
Add Pocket integration
This commit is contained in:
parent
f19ab21b7d
commit
0f3f5e442f
16 changed files with 137 additions and 15 deletions
|
@ -70,7 +70,10 @@ func (s *Storage) Integration(userID int64) (*model.Integration, error) {
|
|||
wallabag_password,
|
||||
nunux_keeper_enabled,
|
||||
nunux_keeper_url,
|
||||
nunux_keeper_api_key
|
||||
nunux_keeper_api_key,
|
||||
pocket_enabled,
|
||||
pocket_access_token,
|
||||
pocket_consumer_key
|
||||
FROM integrations
|
||||
WHERE user_id=$1
|
||||
`
|
||||
|
@ -97,6 +100,9 @@ func (s *Storage) Integration(userID int64) (*model.Integration, error) {
|
|||
&integration.NunuxKeeperEnabled,
|
||||
&integration.NunuxKeeperURL,
|
||||
&integration.NunuxKeeperAPIKey,
|
||||
&integration.PocketEnabled,
|
||||
&integration.PocketAccessToken,
|
||||
&integration.PocketConsumerKey,
|
||||
)
|
||||
switch {
|
||||
case err == sql.ErrNoRows:
|
||||
|
@ -131,8 +137,11 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error {
|
|||
wallabag_password=$17,
|
||||
nunux_keeper_enabled=$18,
|
||||
nunux_keeper_url=$19,
|
||||
nunux_keeper_api_key=$20
|
||||
WHERE user_id=$21
|
||||
nunux_keeper_api_key=$20,
|
||||
pocket_enabled=$21,
|
||||
pocket_access_token=$22,
|
||||
pocket_consumer_key=$23
|
||||
WHERE user_id=$24
|
||||
`
|
||||
_, err := s.db.Exec(
|
||||
query,
|
||||
|
@ -156,6 +165,9 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error {
|
|||
integration.NunuxKeeperEnabled,
|
||||
integration.NunuxKeeperURL,
|
||||
integration.NunuxKeeperAPIKey,
|
||||
integration.PocketEnabled,
|
||||
integration.PocketAccessToken,
|
||||
integration.PocketConsumerKey,
|
||||
integration.UserID,
|
||||
)
|
||||
|
||||
|
@ -182,7 +194,7 @@ func (s *Storage) HasSaveEntry(userID int64) (result bool) {
|
|||
query := `
|
||||
SELECT true FROM integrations
|
||||
WHERE user_id=$1 AND
|
||||
(pinboard_enabled='t' OR instapaper_enabled='t' OR wallabag_enabled='t' OR nunux_keeper_enabled='t')
|
||||
(pinboard_enabled='t' OR instapaper_enabled='t' OR wallabag_enabled='t' OR nunux_keeper_enabled='t' OR pocket_enabled='t')
|
||||
`
|
||||
|
||||
if err := s.db.QueryRow(query, userID).Scan(&result); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue