mirror of
https://github.com/miniflux/v2.git
synced 2025-06-27 16:36:00 +00:00
If the website URL is empty, assign the feed URL
This commit is contained in:
parent
d2b137d038
commit
ec63cbe7bb
1 changed files with 8 additions and 0 deletions
|
@ -75,6 +75,10 @@ func (h *Handler) CreateFeed(userID, categoryID int64, url string, crawler bool)
|
||||||
subscription.UserID = userID
|
subscription.UserID = userID
|
||||||
subscription.Crawler = crawler
|
subscription.Crawler = crawler
|
||||||
|
|
||||||
|
if subscription.SiteURL == "" {
|
||||||
|
subscription.SiteURL = subscription.FeedURL
|
||||||
|
}
|
||||||
|
|
||||||
err = h.store.CreateFeed(subscription)
|
err = h.store.CreateFeed(subscription)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -171,6 +175,10 @@ func (h *Handler) RefreshFeed(userID, feedID int64) error {
|
||||||
originalFeed.ParsingErrorCount = 0
|
originalFeed.ParsingErrorCount = 0
|
||||||
originalFeed.ParsingErrorMsg = ""
|
originalFeed.ParsingErrorMsg = ""
|
||||||
|
|
||||||
|
if originalFeed.SiteURL == "" {
|
||||||
|
originalFeed.SiteURL = originalFeed.FeedURL
|
||||||
|
}
|
||||||
|
|
||||||
return h.store.UpdateFeed(originalFeed)
|
return h.store.UpdateFeed(originalFeed)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue