Browse Source

Sort articles newest first

master
2577 3 years ago
parent
commit
4affa5cda6
  1. 4
      feed.go

4
feed.go

@ -194,7 +194,7 @@ func (f feed) items() []feedItem {
f.bolt.View(func(tx *bbolt.Tx) error {
b := tx.Bucket(feedBucket)
c := b.Cursor()
for k, v := c.First(); k != nil; k, v = c.Next() {
for k, v := c.Last(); k != nil; k, v = c.Prev() {
var item feedItem
err := json.Unmarshal(v, &item)
if err != nil {
@ -218,7 +218,7 @@ func (f feed) rss() string {
f.bolt.View(func(tx *bbolt.Tx) error {
b := tx.Bucket(feedBucket)
c := b.Cursor()
for k, v := c.First(); k != nil; k, v = c.Next() {
for k, v := c.Last(); k != nil; k, v = c.Prev() {
var item feedItem
err := json.Unmarshal(v, &item)
if err != nil {

Loading…
Cancel
Save