diff --git a/Frameworks/Account/NewsBlur/Models/NewsBlurStory.swift b/Frameworks/Account/NewsBlur/Models/NewsBlurStory.swift index a8ccf5881..8ac098ef6 100644 --- a/Frameworks/Account/NewsBlur/Models/NewsBlurStory.swift +++ b/Frameworks/Account/NewsBlur/Models/NewsBlurStory.swift @@ -22,11 +22,16 @@ struct NewsBlurStoriesResponse: Decodable { let url: String? let authorName: String? let contentHTML: String? + var imageURL: String? { + return imageURLs?.first + } + var tags: [String]? var datePublished: Date? { let interval = (publishedTimestamp as NSString).doubleValue return Date(timeIntervalSince1970: interval) } + private var imageURLs: [String]? private var publishedTimestamp: String } } @@ -45,6 +50,8 @@ extension NewsBlurStoriesResponse.Story { case url = "story_permalink" case authorName = "story_authors" case contentHTML = "story_content" + case imageURLs = "image_urls" + case tags = "story_tags" case publishedTimestamp = "story_timestamp" } } diff --git a/Frameworks/Account/NewsBlur/NewsBlurAccountDelegate+Private.swift b/Frameworks/Account/NewsBlur/NewsBlurAccountDelegate+Private.swift index 1eff39d50..51a8e6fc7 100644 --- a/Frameworks/Account/NewsBlur/NewsBlurAccountDelegate+Private.swift +++ b/Frameworks/Account/NewsBlur/NewsBlurAccountDelegate+Private.swift @@ -261,7 +261,7 @@ extension NewsBlurAccountDelegate { let parsedItems: [ParsedItem] = stories.map { story in let author = Set([ParsedAuthor(name: story.authorName, url: nil, avatarURL: nil, emailAddress: nil)]) - return ParsedItem(syncServiceID: story.storyID, uniqueID: String(story.storyID), feedURL: String(story.feedID), url: story.url, externalURL: nil, title: story.title, contentHTML: story.contentHTML, contentText: nil, summary: nil, imageURL: nil, bannerImageURL: nil, datePublished: story.datePublished, dateModified: nil, authors: author, tags: nil, attachments: nil) + return ParsedItem(syncServiceID: story.storyID, uniqueID: String(story.storyID), feedURL: String(story.feedID), url: story.url, externalURL: nil, title: story.title, contentHTML: story.contentHTML, contentText: nil, summary: nil, imageURL: story.imageURL, bannerImageURL: nil, datePublished: story.datePublished, dateModified: nil, authors: author, tags: Set(story.tags ?? []), attachments: nil) } return Set(parsedItems)