diff --git a/reader/feed/handler.go b/reader/feed/handler.go index 83cbc6f9a1be5aedd89e3867ddb75aa9e8cf85e7..35ad3881826f8a414830057495d7ee365f9ac213 100644 --- a/reader/feed/handler.go +++ b/reader/feed/handler.go @@ -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) }