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
|
@ -19,6 +19,7 @@ type FeedForm struct {
|
|||
Title string
|
||||
ScraperRules string
|
||||
RewriteRules string
|
||||
Crawler bool
|
||||
CategoryID int64
|
||||
}
|
||||
|
||||
|
@ -38,6 +39,7 @@ func (f FeedForm) Merge(feed *model.Feed) *model.Feed {
|
|||
feed.FeedURL = f.FeedURL
|
||||
feed.ScraperRules = f.ScraperRules
|
||||
feed.RewriteRules = f.RewriteRules
|
||||
feed.Crawler = f.Crawler
|
||||
feed.ParsingErrorCount = 0
|
||||
feed.ParsingErrorMsg = ""
|
||||
return feed
|
||||
|
@ -56,6 +58,7 @@ func NewFeedForm(r *http.Request) *FeedForm {
|
|||
Title: r.FormValue("title"),
|
||||
ScraperRules: r.FormValue("scraper_rules"),
|
||||
RewriteRules: r.FormValue("rewrite_rules"),
|
||||
Crawler: r.FormValue("crawler") == "1",
|
||||
CategoryID: int64(categoryID),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import (
|
|||
type SubscriptionForm struct {
|
||||
URL string
|
||||
CategoryID int64
|
||||
Crawler bool
|
||||
}
|
||||
|
||||
// Validate makes sure the form values are valid.
|
||||
|
@ -35,6 +36,7 @@ func NewSubscriptionForm(r *http.Request) *SubscriptionForm {
|
|||
|
||||
return &SubscriptionForm{
|
||||
URL: r.FormValue("url"),
|
||||
Crawler: r.FormValue("crawler") == "1",
|
||||
CategoryID: int64(categoryID),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue