Fix some build errors.

This commit is contained in:
Brent Simmons
2024-08-26 19:27:30 -07:00
parent 0f8c529d0d
commit c261aff21f
3 changed files with 10 additions and 18 deletions

View File

@@ -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)
}
}

View File

@@ -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)
}
}

View File

@@ -1,10 +0,0 @@
//
// File.swift
//
//
// Created by Brent Simmons on 4/7/24.
//
import Foundation
extension RSHTMLMetadataParser: @unchecked Sendable {}