mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-11 09:14:06 +01:00
Add Feedbin external url handling. Fixes #3239
This commit is contained in:
parent
25370cc0af
commit
3512646261
@ -1259,7 +1259,7 @@ private extension FeedbinAccountDelegate {
|
||||
|
||||
let parsedItems: [ParsedItem] = entries.map { entry in
|
||||
let authors = Set([ParsedAuthor(name: entry.authorName, url: entry.jsonFeed?.jsonFeedAuthor?.url, avatarURL: entry.jsonFeed?.jsonFeedAuthor?.avatarURL, emailAddress: nil)])
|
||||
return ParsedItem(syncServiceID: String(entry.articleID), uniqueID: String(entry.articleID), feedURL: String(entry.feedID), url: entry.url, externalURL: nil, title: entry.title, language: nil, contentHTML: entry.contentHTML, contentText: nil, summary: entry.summary, imageURL: nil, bannerImageURL: nil, datePublished: entry.parsedDatePublished, dateModified: nil, authors: authors, tags: nil, attachments: nil)
|
||||
return ParsedItem(syncServiceID: String(entry.articleID), uniqueID: String(entry.articleID), feedURL: String(entry.feedID), url: entry.url, externalURL: entry.jsonFeed?.jsonFeedExternalURL, title: entry.title, language: nil, contentHTML: entry.contentHTML, contentText: nil, summary: entry.summary, imageURL: nil, bannerImageURL: nil, datePublished: entry.parsedDatePublished, dateModified: nil, authors: authors, tags: nil, attachments: nil)
|
||||
}
|
||||
|
||||
return Set(parsedItems)
|
||||
|
@ -52,9 +52,11 @@ final class FeedbinEntry: Decodable {
|
||||
|
||||
struct FeedbinEntryJSONFeed: Decodable {
|
||||
let jsonFeedAuthor: FeedbinEntryJSONFeedAuthor?
|
||||
|
||||
let jsonFeedExternalURL: String?
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case jsonFeedAuthor = "author"
|
||||
case jsonFeedExternalURL = "external_url"
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
@ -64,6 +66,11 @@ struct FeedbinEntryJSONFeed: Decodable {
|
||||
} catch {
|
||||
jsonFeedAuthor = nil
|
||||
}
|
||||
do {
|
||||
jsonFeedExternalURL = try container.decode(String.self, forKey: .jsonFeedExternalURL)
|
||||
} catch {
|
||||
jsonFeedExternalURL = nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user