Getting the feed URL from the feed ID if it isn't supplied.

This commit is contained in:
Maurice Parker 2020-10-24 21:37:18 -05:00
parent a273398317
commit 3e9f208dff
1 changed files with 9 additions and 2 deletions

View File

@ -47,7 +47,7 @@ struct ReaderAPISubscription: Codable {
let feedID: String
let name: String?
let categories: [ReaderAPICategory]
let url: String
let feedURL: String?
let homePageURL: String?
let iconURL: String?
@ -55,11 +55,18 @@ struct ReaderAPISubscription: Codable {
case feedID = "id"
case name = "title"
case categories = "categories"
case url = "url"
case feedURL = "url"
case homePageURL = "htmlUrl"
case iconURL = "iconUrl"
}
var url: String {
if let feedURL = feedURL {
return feedURL
} else {
return feedID.stripping(prefix: "feed/")
}
}
}
struct ReaderAPICategory: Codable {