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

Create feed query builder

This commit is contained in:
Shizun Ge 2021-01-18 15:22:09 -06:00 committed by GitHub
parent 433de17562
commit 02a4c9db53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 343 additions and 306 deletions

View file

@ -5,6 +5,7 @@
package storage // import "miniflux.app/storage"
import (
"database/sql"
"fmt"
"strings"
"time"
@ -269,7 +270,7 @@ func (e *EntryQueryBuilder) GetEntries() (model.Entries, error) {
entries := make(model.Entries, 0)
for rows.Next() {
var entry model.Entry
var iconID interface{}
var iconID sql.NullInt64
var tz string
entry.Feed = &model.Feed{}
@ -310,10 +311,10 @@ func (e *EntryQueryBuilder) GetEntries() (model.Entries, error) {
return nil, fmt.Errorf("unable to fetch entry row: %v", err)
}
if iconID == nil {
entry.Feed.Icon.IconID = 0
if iconID.Valid {
entry.Feed.Icon.IconID = iconID.Int64
} else {
entry.Feed.Icon.IconID = iconID.(int64)
entry.Feed.Icon.IconID = 0
}
// Make sure that timestamp fields contains timezone information (API)