Add thumbnail downloading activity.

This commit is contained in:
Brent Simmons committed 2026-10-25 14:38:04 -07:00
1 parent 7aff08caac
commit 2c8fb1a316
2 files changed
+12 -2

No files matched your search

@@ -63,6 +63,7 @@ public enum ActivityKind: Sendable, Hashable {
case downloadFavicon(faviconURL: String)
case downloadAvatar(avatarURL: String)
case downloadHTMLMetadata(urlString: String)
case downloadThumbnail(imageURL: String)
/// Localized description for activity kinds that don't carry a URL to display separately.
/// Returns nil for the URL-bearing cases — each caller renders its own primary + URL form.
@@ -124,7 +125,7 @@ public enum ActivityKind: Sendable, Hashable {
return NSLocalizedString("Validating credentials", bundle: .module, comment: "Activity kind")
case .exportOPML:
return NSLocalizedString("Exporting OPML", bundle: .module, comment: "Activity kind")
case .refreshFeedContent, .findFeed, .fetchFeedCandidate, .downloadFeedImage, .downloadFavicon, .downloadAvatar, .downloadHTMLMetadata:
case .refreshFeedContent, .findFeed, .fetchFeedCandidate, .downloadFeedImage, .downloadFavicon, .downloadAvatar, .downloadHTMLMetadata, .downloadThumbnail:
return nil
}
}
@@ -157,6 +158,9 @@ public enum ActivityKind: Sendable, Hashable {
case .downloadHTMLMetadata(let urlString):
let format = NSLocalizedString("Downloading metadata %@", bundle: .module, comment: "Activity kind — downloading HTML metadata — %@ is the URL")
return String(format: format, urlString)
case .downloadThumbnail(let imageURL):
let format = NSLocalizedString("Downloading thumbnail %@", bundle: .module, comment: "Activity kind — downloading a timeline thumbnail — %@ is the URL")
return String(format: format, imageURL)
default:
return ""
}
@@ -16,6 +16,7 @@ public enum ActivityOwner: Sendable, Hashable {
case faviconDownloader
case avatarDownloader
case htmlMetadataDownloader
case thumbnailDownloader
public var displayName: String {
switch self {
@@ -33,6 +34,8 @@ public enum ActivityOwner: Sendable, Hashable {
return NSLocalizedString("Avatars", bundle: .module, comment: "Activity owner name")
case .htmlMetadataDownloader:
return NSLocalizedString("HTML Metadata", bundle: .module, comment: "Activity owner name")
case .thumbnailDownloader:
return NSLocalizedString("Thumbnails", bundle: .module, comment: "Activity owner name")
}
}
@@ -46,7 +49,8 @@ public enum ActivityOwner: Sendable, Hashable {
(.feedImageDownloader, .feedImageDownloader),
(.faviconDownloader, .faviconDownloader),
(.avatarDownloader, .avatarDownloader),
(.htmlMetadataDownloader, .htmlMetadataDownloader):
(.htmlMetadataDownloader, .htmlMetadataDownloader),
(.thumbnailDownloader, .thumbnailDownloader):
return true
case (.account(let lhsID, _), .account(let rhsID, _)):
return lhsID == rhsID
@@ -72,6 +76,8 @@ public enum ActivityOwner: Sendable, Hashable {
hasher.combine(5)
case .htmlMetadataDownloader:
hasher.combine(6)
case .thumbnailDownloader:
hasher.combine(7)
}
}
}