diff options
author | 2024-05-02 16:15:47 +0200 | |
---|---|---|
committer | 2024-05-06 15:40:36 -0700 | |
commit | a33b1adf138efbaf442129d501dda198af18390d (patch) | |
tree | 6dd24c0af76c1a926286d5e0255e10590a23067e /internal/model/feed.go | |
parent | a631bd527d73b5b8d8e85343a1d5fe438e89dad7 (diff) | |
download | v2-a33b1adf138efbaf442129d501dda198af18390d.tar.gz v2-a33b1adf138efbaf442129d501dda198af18390d.tar.zst v2-a33b1adf138efbaf442129d501dda198af18390d.zip |
Add description field to feed settings
This adds a new "description" field to the feed settings. This allows to
save custom description regarding a feed. It is also exported and
imported as "description" in OPML.
Diffstat (limited to 'internal/model/feed.go')
-rw-r--r-- | internal/model/feed.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/model/feed.go b/internal/model/feed.go index 5273eea2..7b89dca0 100644 --- a/internal/model/feed.go +++ b/internal/model/feed.go @@ -28,6 +28,7 @@ type Feed struct { FeedURL string `json:"feed_url"` SiteURL string `json:"site_url"` Title string `json:"title"` + Description string `json:"description"` CheckedAt time.Time `json:"checked_at"` NextCheckAt time.Time `json:"next_check_at"` EtagHeader string `json:"etag_header"` @@ -167,6 +168,7 @@ type FeedModificationRequest struct { FeedURL *string `json:"feed_url"` SiteURL *string `json:"site_url"` Title *string `json:"title"` + Description *string `json:"description"` ScraperRules *string `json:"scraper_rules"` RewriteRules *string `json:"rewrite_rules"` BlocklistRules *string `json:"blocklist_rules"` @@ -201,6 +203,10 @@ func (f *FeedModificationRequest) Patch(feed *Feed) { feed.Title = *f.Title } + if f.Description != nil && *f.Description != "" { + feed.Description = *f.Description + } + if f.ScraperRules != nil { feed.ScraperRules = *f.ScraperRules } |