From c261aff21fd10d85ffe6dd40c993f0ba1e3cdb6d Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 26 Aug 2024 19:27:30 -0700 Subject: [PATCH] Fix some build errors. --- .../Parser/Sources/Parser/Feeds/ParsedAuthor.swift | 6 +++--- Modules/Parser/Sources/Parser/OPML/OPMLItem.swift | 12 +++++++----- .../Sources/Parser/RSHTMLMetadata+Parser.swift | 10 ---------- 3 files changed, 10 insertions(+), 18 deletions(-) delete mode 100644 Modules/Parser/Sources/Parser/RSHTMLMetadata+Parser.swift diff --git a/Modules/Parser/Sources/Parser/Feeds/ParsedAuthor.swift b/Modules/Parser/Sources/Parser/Feeds/ParsedAuthor.swift index ded26d415..01e91e2ad 100644 --- a/Modules/Parser/Sources/Parser/Feeds/ParsedAuthor.swift +++ b/Modules/Parser/Sources/Parser/Feeds/ParsedAuthor.swift @@ -26,11 +26,11 @@ public struct ParsedAuthor: Hashable, Codable, Sendable { init(singleString: String) { if singleString.contains("@") { - init(name: nil, url: nil, avatarURL: nil, emailAddress: singleString) + self.init(name: nil, url: nil, avatarURL: nil, emailAddress: singleString) } else if singleString.lowercased().hasPrefix("http") { - init(name: nil, url: singleString, avatarURL: nil, emailAddress: nil) + self.init(name: nil, url: singleString, avatarURL: nil, emailAddress: nil) } else { - init(name: singleString, url: nil, avatarURL: nil, emailAddress: nil) + self.init(name: singleString, url: nil, avatarURL: nil, emailAddress: nil) } } diff --git a/Modules/Parser/Sources/Parser/OPML/OPMLItem.swift b/Modules/Parser/Sources/Parser/OPML/OPMLItem.swift index 35b2c3eac..9a1e0b23e 100644 --- a/Modules/Parser/Sources/Parser/OPML/OPMLItem.swift +++ b/Modules/Parser/Sources/Parser/OPML/OPMLItem.swift @@ -10,22 +10,24 @@ import os public class OPMLItem { - public let feedSpecifier: OPMLFeedSpecifier + public let feedSpecifier: OPMLFeedSpecifier? - public let attributes: [String: String] + public let attributes: [String: String]? public let titleFromAttributes: String? public var items: [OPMLItem]? public var isFolder: Bool { - items.count > 0 + (items?.count ?? 0) > 0 } init(attributes: [String : String]?) { - self.titleFromAttributes = attributes.opml_title ?? attributes.opml_text + self.titleFromAttributes = attributes?.opml_title ?? attributes?.opml_text self.attributes = attributes - self.feedSpecifier = ParsedOPMLFeedSpecifier(title: self.titleFromAttributes, feedDescription: attributes.opml_description, homePageURL: attributes.opml_htmlUrl, feedURL: attributes.opml_xmlUrl) + if let feedURL = attributes?.opml_xmlUrl { + self.feedSpecifier = OPMLFeedSpecifier(title: self.titleFromAttributes, feedDescription: attributes?.opml_description, homePageURL: attributes?.opml_htmlUrl, feedURL: feedURL) + } } diff --git a/Modules/Parser/Sources/Parser/RSHTMLMetadata+Parser.swift b/Modules/Parser/Sources/Parser/RSHTMLMetadata+Parser.swift deleted file mode 100644 index 391380b22..000000000 --- a/Modules/Parser/Sources/Parser/RSHTMLMetadata+Parser.swift +++ /dev/null @@ -1,10 +0,0 @@ -// -// File.swift -// -// -// Created by Brent Simmons on 4/7/24. -// - -import Foundation - -extension RSHTMLMetadataParser: @unchecked Sendable {}