mirror of
https://github.com/miniflux/v2.git
synced 2025-08-01 17:38:37 +00:00
Add the possibility to enable crawler for feeds
This commit is contained in:
parent
33445e5b68
commit
ef097f02fe
22 changed files with 77 additions and 25 deletions
|
@ -8,6 +8,8 @@ import (
|
|||
"errors"
|
||||
"log"
|
||||
|
||||
"github.com/miniflux/miniflux2/reader/sanitizer"
|
||||
|
||||
"github.com/miniflux/miniflux2/integration"
|
||||
"github.com/miniflux/miniflux2/model"
|
||||
"github.com/miniflux/miniflux2/reader/scraper"
|
||||
|
@ -46,10 +48,10 @@ func (c *Controller) FetchContent(ctx *core.Context, request *core.Request, resp
|
|||
return
|
||||
}
|
||||
|
||||
entry.Content = content
|
||||
entry.Content = sanitizer.Sanitize(entry.URL, content)
|
||||
c.store.UpdateEntryContent(entry)
|
||||
|
||||
response.JSON().Created(map[string]string{"content": content})
|
||||
response.JSON().Created(map[string]string{"content": entry.Content})
|
||||
}
|
||||
|
||||
// SaveEntry send the link to external services.
|
||||
|
|
|
@ -222,6 +222,7 @@ func (c *Controller) getFeedFormTemplateArgs(ctx *core.Context, user *model.User
|
|||
Title: feed.Title,
|
||||
ScraperRules: feed.ScraperRules,
|
||||
RewriteRules: feed.RewriteRules,
|
||||
Crawler: feed.Crawler,
|
||||
CategoryID: feed.Category.ID,
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -80,7 +80,7 @@ func (c *Controller) SubmitSubscription(ctx *core.Context, request *core.Request
|
|||
"errorMessage": "Unable to find any subscription.",
|
||||
}))
|
||||
case n == 1:
|
||||
feed, err := c.feedHandler.CreateFeed(user.ID, subscriptionForm.CategoryID, subscriptions[0].URL)
|
||||
feed, err := c.feedHandler.CreateFeed(user.ID, subscriptionForm.CategoryID, subscriptions[0].URL, subscriptionForm.Crawler)
|
||||
if err != nil {
|
||||
response.HTML().Render("add_subscription", args.Merge(tplParams{
|
||||
"form": subscriptionForm,
|
||||
|
@ -117,7 +117,7 @@ func (c *Controller) ChooseSubscription(ctx *core.Context, request *core.Request
|
|||
return
|
||||
}
|
||||
|
||||
feed, err := c.feedHandler.CreateFeed(user.ID, subscriptionForm.CategoryID, subscriptionForm.URL)
|
||||
feed, err := c.feedHandler.CreateFeed(user.ID, subscriptionForm.CategoryID, subscriptionForm.URL, subscriptionForm.Crawler)
|
||||
if err != nil {
|
||||
response.HTML().Render("add_subscription", args.Merge(tplParams{
|
||||
"form": subscriptionForm,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue