From ec63cbe7bb0455d76c4505abbfd546a1b056f807 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= <fred@miniflux.net>
Date: Wed, 3 Jan 2018 18:23:21 -0800
Subject: [PATCH] If the website URL is empty, assign the feed URL

---
 reader/feed/handler.go | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/reader/feed/handler.go b/reader/feed/handler.go
index 83cbc6f9..35ad3881 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)
 }
 
-- 
GitLab