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.Crawler = crawler
|
||||
|
||||
if subscription.SiteURL == "" {
|
||||
subscription.SiteURL = subscription.FeedURL
|
||||
}
|
||||
|
||||
err = h.store.CreateFeed(subscription)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -171,6 +175,10 @@ func (h *Handler) RefreshFeed(userID, feedID int64) error {
|
|||
originalFeed.ParsingErrorCount = 0
|
||||
originalFeed.ParsingErrorMsg = ""
|
||||
|
||||
if originalFeed.SiteURL == "" {
|
||||
originalFeed.SiteURL = originalFeed.FeedURL
|
||||
}
|
||||
|
||||
return h.store.UpdateFeed(originalFeed)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue