mirror of
https://github.com/glanceapp/glance.git
synced 2024-12-15 09:34:26 +03:00
fix: add detailed mode flag to fix RSS logic conflict
This commit is contained in:
parent
b83bf9bc09
commit
d3e3667405
@ -49,6 +49,7 @@ type RSSFeedRequest struct {
|
|||||||
HideCategories bool `yaml:"hide-categories"`
|
HideCategories bool `yaml:"hide-categories"`
|
||||||
HideDescription bool `yaml:"hide-description"`
|
HideDescription bool `yaml:"hide-description"`
|
||||||
ItemLinkPrefix string `yaml:"item-link-prefix"`
|
ItemLinkPrefix string `yaml:"item-link-prefix"`
|
||||||
|
IsDetailed bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type RSSFeedItems []RSSFeedItem
|
type RSSFeedItems []RSSFeedItem
|
||||||
@ -107,6 +108,7 @@ func getItemsFromRSSFeedTask(request RSSFeedRequest) ([]RSSFeedItem, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if request.IsDetailed {
|
||||||
if !request.HideDescription && item.Description != "" {
|
if !request.HideDescription && item.Description != "" {
|
||||||
description, _ := limitStringLength(item.Description, 1000)
|
description, _ := limitStringLength(item.Description, 1000)
|
||||||
description = sanitizeFeedDescription(description)
|
description = sanitizeFeedDescription(description)
|
||||||
@ -136,6 +138,7 @@ func getItemsFromRSSFeedTask(request RSSFeedRequest) ([]RSSFeedItem, error) {
|
|||||||
|
|
||||||
rssItem.Categories = categories
|
rssItem.Categories = categories
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if request.Title != "" {
|
if request.Title != "" {
|
||||||
rssItem.ChannelName = request.Title
|
rssItem.ChannelName = request.Title
|
||||||
|
@ -39,10 +39,9 @@ func (widget *RSS) Initialize() error {
|
|||||||
widget.CardHeight = 0
|
widget.CardHeight = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
if widget.Style != "detailed-list" {
|
if widget.Style == "detailed-list" {
|
||||||
for i := range widget.FeedRequests {
|
for i := range widget.FeedRequests {
|
||||||
widget.FeedRequests[i].HideCategories = true
|
widget.FeedRequests[i].IsDetailed = true
|
||||||
widget.FeedRequests[i].HideDescription = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user