diff --git a/AltStoreCore/Model/AltStore.xcdatamodeld/AltStore 11.xcdatamodel/contents b/AltStoreCore/Model/AltStore.xcdatamodeld/AltStore 11.xcdatamodel/contents index cceed50f..94c3b425 100644 --- a/AltStoreCore/Model/AltStore.xcdatamodeld/AltStore 11.xcdatamodel/contents +++ b/AltStoreCore/Model/AltStore.xcdatamodeld/AltStore 11.xcdatamodel/contents @@ -103,6 +103,7 @@ + diff --git a/AltStoreCore/Model/NewsItem.swift b/AltStoreCore/Model/NewsItem.swift index 22e86eb8..62fdb9db 100644 --- a/AltStoreCore/Model/NewsItem.swift +++ b/AltStoreCore/Model/NewsItem.swift @@ -32,6 +32,15 @@ public class NewsItem: NSManagedObject, Decodable, Fetchable @NSManaged public var storeApp: StoreApp? @NSManaged public var source: Source? + @objc public var isDuplicate: Bool { + if self.source == nil { return false } + + // Hide news from sources that begin with the SideStore identifier, and aren't from the same source as the current SideStore source + if self.source!.identifier.starts(with: Bundle.Info.appbundleIdentifier) && self.source!.identifier != Source.altStoreIdentifier { return true } + + return false + } + private enum CodingKeys: String, CodingKey { case identifier @@ -86,6 +95,9 @@ public extension NewsItem { @nonobjc class func fetchRequest() -> NSFetchRequest { - return NSFetchRequest(entityName: "NewsItem") + let fetchRequest = NSFetchRequest(entityName: "NewsItem") + fetchRequest.predicate = NSPredicate(format: "%K == NO", + #keyPath(NewsItem.isDuplicate)) + return fetchRequest } }