mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Disable Reader View
This commit: - adds a `isFeedProvider: Bool` property to `WebFeed` - if `isFeedProvider` is `true`, the article extractor is disabled on the inspector, hidden from the context menu, and the toolbar button is disabled. Additionally, if `isFeedProvider` is `true`, `isArticleExtractorAlwaysOn` returns `false` and cannot be set to `true`.
This commit is contained in:
@@ -152,9 +152,14 @@ public final class WebFeed: Feed, Renamable, Hashable {
|
||||
|
||||
public var isArticleExtractorAlwaysOn: Bool? {
|
||||
get {
|
||||
if isFeedProvider == true { return false } // not an option for FeedProviders
|
||||
return metadata.isArticleExtractorAlwaysOn
|
||||
}
|
||||
set {
|
||||
if isFeedProvider == true {
|
||||
metadata.isArticleExtractorAlwaysOn = false
|
||||
return
|
||||
}
|
||||
metadata.isArticleExtractorAlwaysOn = newValue
|
||||
}
|
||||
}
|
||||
@@ -220,6 +225,16 @@ public final class WebFeed: Feed, Renamable, Hashable {
|
||||
postUnreadCountDidChangeNotification()
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Feed Provider
|
||||
public var isFeedProvider: Bool {
|
||||
get {
|
||||
if FeedProviderManager.shared.best(for: URLComponents(url: URL(string: url)!, resolvingAgainstBaseURL: false)!) == nil {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
var metadata: WebFeedMetadata
|
||||
|
||||
|
||||
Reference in New Issue
Block a user