mirror of
https://github.com/miniflux/v2.git
synced 2025-09-30 19:22:11 +00:00
Merge 0e28c0610a
into 8adcaed29e
This commit is contained in:
commit
be03f66eff
5 changed files with 73 additions and 1 deletions
|
@ -52,6 +52,21 @@ func (s *Storage) UserByFeverToken(token string) (*model.User, error) {
|
|||
}
|
||||
}
|
||||
|
||||
func (s *Storage) IsFeverUsed() (bool, error) {
|
||||
query := `SELECT true FROM integrations WHERE fever_enabled=true LIMIT 1`
|
||||
result := false
|
||||
err := s.db.QueryRow(query).Scan(&result)
|
||||
|
||||
if err != nil {
|
||||
if err == sql.ErrNoRows {
|
||||
return false, nil
|
||||
}
|
||||
return false, fmt.Errorf(`store: unable to check if fever is used: %v`, err)
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// GoogleReaderUserCheckPassword validates the Google Reader hashed password.
|
||||
func (s *Storage) GoogleReaderUserCheckPassword(username, password string) error {
|
||||
var hash string
|
||||
|
@ -105,6 +120,21 @@ func (s *Storage) GoogleReaderUserGetIntegration(username string) (*model.Integr
|
|||
return &integration, nil
|
||||
}
|
||||
|
||||
func (s *Storage) IsGoogleReaderUsed() (bool, error) {
|
||||
query := `SELECT true FROM integrations WHERE googlereader_enabled=true LIMIT 1`
|
||||
var result bool
|
||||
err := s.db.QueryRow(query).Scan(&result)
|
||||
|
||||
if err != nil {
|
||||
if err == sql.ErrNoRows {
|
||||
return false, nil
|
||||
}
|
||||
return false, fmt.Errorf(`store: unable to check if Google Reader is used: %v`, err)
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// Integration returns user integration settings.
|
||||
func (s *Storage) Integration(userID int64) (*model.Integration, error) {
|
||||
query := `
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue