mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-16 10:13:27 +01:00
Release channel support (#239)
* Release channel support - Show SideStore in Browse if it's not from the current SideStore source - Change SideStore source URL and source ID based on if beta and nightly are in the version string - Use StoreApp name for InstalledApp name to allow for source-specified name to show up in My Apps * My Apps: Fix incorrect app name on first launch * News: fix duplicate news items from multiple SideStore release channel sources * Trusted Sources: Add stable and beta
This commit is contained in:
@@ -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<NewsItem>
|
||||
{
|
||||
return NSFetchRequest<NewsItem>(entityName: "NewsItem")
|
||||
let fetchRequest = NSFetchRequest<NewsItem>(entityName: "NewsItem")
|
||||
fetchRequest.predicate = NSPredicate(format: "%K == NO",
|
||||
#keyPath(NewsItem.isDuplicate))
|
||||
return fetchRequest
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user