mirror of
https://github.com/nkanaev/yarr.git
synced 2026-06-10 02:13:21 +00:00
golines -w src
This commit is contained in:
@@ -78,7 +78,11 @@ func TestParseFallback(t *testing.T) {
|
||||
Folders: []Folder{{
|
||||
Title: "foldertitle",
|
||||
Feeds: []Feed{
|
||||
{Title: "feedtext", FeedUrl: "https://example.com/feed.xml", SiteUrl: "https://example.com"},
|
||||
{
|
||||
Title: "feedtext",
|
||||
FeedUrl: "https://example.com/feed.xml",
|
||||
SiteUrl: "https://example.com",
|
||||
},
|
||||
},
|
||||
}},
|
||||
}
|
||||
|
||||
@@ -77,7 +77,8 @@ func (s *Server) handleStatic(c *router.Context) {
|
||||
c.Out.WriteHeader(http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
http.StripPrefix(s.BasePath+"/static/", http.FileServer(http.FS(assets.FS))).ServeHTTP(c.Out, c.Req)
|
||||
http.StripPrefix(s.BasePath+"/static/", http.FileServer(http.FS(assets.FS))).
|
||||
ServeHTTP(c.Out, c.Req)
|
||||
}
|
||||
|
||||
func (s *Server) handleManifest(c *router.Context) {
|
||||
@@ -236,7 +237,10 @@ func (s *Server) handleFeedList(c *router.Context) {
|
||||
log.Printf("Faild to discover feed for %s: %s", form.Url, err)
|
||||
c.JSON(http.StatusOK, map[string]string{"status": "notfound"})
|
||||
case len(result.Sources) > 0:
|
||||
c.JSON(http.StatusOK, map[string]interface{}{"status": "multiple", "choice": result.Sources})
|
||||
c.JSON(
|
||||
http.StatusOK,
|
||||
map[string]interface{}{"status": "multiple", "choice": result.Sources},
|
||||
)
|
||||
case result.Feed != nil:
|
||||
feed := s.db.CreateFeed(
|
||||
result.Feed.Title,
|
||||
|
||||
@@ -28,4 +28,4 @@ func TestIsInternalFromURL(t *testing.T) {
|
||||
t.Errorf("isInternalFromURL(%q) = %v; want %v", test.url, result, test.expected)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user