1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-26 18:21:01 +00:00

Parse <category> from Feeds (RSS, Atom and JSON)

This commit is contained in:
privatmamtora 2023-02-25 04:52:45 +00:00 committed by GitHub
parent ff8d68c151
commit 8f9ccc6540
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 252 additions and 11 deletions

View file

@ -135,6 +135,17 @@ func (e *EntryQueryBuilder) WithStatuses(statuses []string) *EntryQueryBuilder {
return e
}
// WithTags filter by a list of entry tags.
func (e *EntryQueryBuilder) WithTags(tags []string) *EntryQueryBuilder {
if len(tags) > 0 {
for _, cat := range tags {
e.conditions = append(e.conditions, fmt.Sprintf("$%d = ANY(e.tags)", len(e.args)+1))
e.args = append(e.args, cat)
}
}
return e
}
// WithoutStatus set the entry status that should not be returned.
func (e *EntryQueryBuilder) WithoutStatus(status string) *EntryQueryBuilder {
if status != "" {
@ -250,6 +261,7 @@ func (e *EntryQueryBuilder) GetEntries() (model.Entries, error) {
e.reading_time,
e.created_at,
e.changed_at,
e.tags,
f.title as feed_title,
f.feed_url,
f.site_url,
@ -312,6 +324,7 @@ func (e *EntryQueryBuilder) GetEntries() (model.Entries, error) {
&entry.ReadingTime,
&entry.CreatedAt,
&entry.ChangedAt,
pq.Array(&entry.Tags),
&entry.Feed.Title,
&entry.Feed.FeedURL,
&entry.Feed.SiteURL,