Fix reverse boltdb list and tests
parent
c4d3b24e5c
commit
c32ef6c099
|
|
@ -107,7 +107,7 @@ func (feed *Feed) fromGofeed(gofeed *gofeed.Feed) ([]*Item, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
feed.Updated = time.Now().UTC() //*updated
|
||||
feed.Updated = *updated //time.Now().UTC() //*updated
|
||||
feed.Title = gofeed.Title
|
||||
return newitems, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ func Test_RSSItem(t *testing.T) {
|
|||
output: Item{
|
||||
Name: "a",
|
||||
Link: "b",
|
||||
Content: `<img src="A"/><br><img src="asdf"/>`,
|
||||
Content: `<a href="b">a</a><br><img src="A"/><br><img src="asdf"/>`,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -35,7 +35,7 @@ func Test_RSSItem(t *testing.T) {
|
|||
output: Item{
|
||||
Name: "a",
|
||||
Link: "b",
|
||||
Content: `<img src="asdf"/>`,
|
||||
Content: `<a href="b">a</a><br><img src="asdf"/>`,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -48,7 +48,7 @@ func Test_RSSItem(t *testing.T) {
|
|||
output: Item{
|
||||
Name: "a",
|
||||
Link: "b",
|
||||
Content: "",
|
||||
Content: `<a href="b">a</a><br>`,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -61,7 +61,7 @@ func Test_RSSItem(t *testing.T) {
|
|||
output: Item{
|
||||
Name: "a",
|
||||
Link: "b",
|
||||
Content: `<img src="asdf"/>`,
|
||||
Content: `<a href="b">a</a><br><img src="asdf"/>`,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -74,7 +74,7 @@ func Test_RSSItem(t *testing.T) {
|
|||
output: Item{
|
||||
Name: "a",
|
||||
Link: "b",
|
||||
Content: "x<br>y",
|
||||
Content: `<a href="b">a</a><br>x<br>y`,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,9 +96,13 @@ func (s *Server) feed(w http.ResponseWriter, r *http.Request) {
|
|||
case "tag":
|
||||
s.getFeedTag(w, r)
|
||||
default:
|
||||
if v == "" {
|
||||
s.bad(w, r)
|
||||
} else {
|
||||
r.URL.Path = v + "/" + r.URL.Path
|
||||
s.getFeed(w, r)
|
||||
}
|
||||
}
|
||||
case "POST":
|
||||
s.newFeed(w, r)
|
||||
case "PUT":
|
||||
|
|
|
|||
|
|
@ -48,7 +48,8 @@ func (bc *BoltClient) List(namespace, key string, asc bool, limit int) ([]string
|
|||
found = append(found, string(k))
|
||||
}
|
||||
} else {
|
||||
for k, _ := c.Seek([]byte(key)); k != nil && len(found) < limit; k, _ = c.Next() {
|
||||
key += "}}}}}}}}}}}}}}}}}}}}}}}}}}}}}"
|
||||
for k, _ := c.Seek([]byte(key)); k != nil && len(found) < limit; k, _ = c.Prev() {
|
||||
found = append(found, string(k))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue