mirror of
https://github.com/glanceapp/glance.git
synced 2024-11-22 08:23:52 +01:00
fix: correct title handling for RSS items without titles
This commit is contained in:
parent
c23dc93c7a
commit
a2b7f59dc9
@ -93,7 +93,6 @@ func getItemsFromRSSFeedTask(request RSSFeedRequest) ([]RSSFeedItem, error) {
|
|||||||
|
|
||||||
rssItem := RSSFeedItem{
|
rssItem := RSSFeedItem{
|
||||||
ChannelURL: feed.Link,
|
ChannelURL: feed.Link,
|
||||||
Title: item.Title,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if request.ItemLinkPrefix != "" {
|
if request.ItemLinkPrefix != "" {
|
||||||
@ -120,8 +119,14 @@ func getItemsFromRSSFeedTask(request RSSFeedRequest) ([]RSSFeedItem, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if item.Title != "" {
|
||||||
|
rssItem.Title = item.Title
|
||||||
|
} else {
|
||||||
|
rssItem.Title = shortenFeedDescriptionLen(item.Description, 100)
|
||||||
|
}
|
||||||
|
|
||||||
if request.IsDetailed {
|
if request.IsDetailed {
|
||||||
if !request.HideDescription && item.Description != "" {
|
if !request.HideDescription && item.Description != "" && item.Title != "" {
|
||||||
rssItem.Description = shortenFeedDescriptionLen(item.Description, 200)
|
rssItem.Description = shortenFeedDescriptionLen(item.Description, 200)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,10 +147,6 @@ func getItemsFromRSSFeedTask(request RSSFeedRequest) ([]RSSFeedItem, error) {
|
|||||||
|
|
||||||
rssItem.Categories = categories
|
rssItem.Categories = categories
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if item.Title == "" {
|
|
||||||
rssItem.Title = shortenFeedDescriptionLen(item.Description, 100)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if request.Title != "" {
|
if request.Title != "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user