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:
parent
433de17562
commit
02a4c9db53
5 changed files with 343 additions and 306 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue