mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-20 12:13:26 +01:00
Remove all restrictions based on Patreon account (hopefully)
This commit is contained in:
@@ -173,15 +173,15 @@ public extension InstalledApp
|
|||||||
{
|
{
|
||||||
var predicate = NSPredicate(format: "%K == YES AND %K != %@", #keyPath(InstalledApp.isActive), #keyPath(InstalledApp.bundleIdentifier), StoreApp.altstoreAppID)
|
var predicate = NSPredicate(format: "%K == YES AND %K != %@", #keyPath(InstalledApp.isActive), #keyPath(InstalledApp.bundleIdentifier), StoreApp.altstoreAppID)
|
||||||
|
|
||||||
if let patreonAccount = DatabaseManager.shared.patreonAccount(in: context), patreonAccount.isPatron, PatreonAPI.shared.isAuthenticated
|
// if let patreonAccount = DatabaseManager.shared.patreonAccount(in: context), patreonAccount.isPatron, PatreonAPI.shared.isAuthenticated
|
||||||
{
|
// {
|
||||||
// No additional predicate
|
// // No additional predicate
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [predicate,
|
// predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [predicate,
|
||||||
NSPredicate(format: "%K == nil OR %K == NO", #keyPath(InstalledApp.storeApp), #keyPath(InstalledApp.storeApp.isBeta))])
|
// NSPredicate(format: "%K == nil OR %K == NO", #keyPath(InstalledApp.storeApp), #keyPath(InstalledApp.storeApp.isBeta))])
|
||||||
}
|
// }
|
||||||
|
|
||||||
var installedApps = InstalledApp.all(satisfying: predicate,
|
var installedApps = InstalledApp.all(satisfying: predicate,
|
||||||
sortedBy: [NSSortDescriptor(keyPath: \InstalledApp.expirationDate, ascending: true)],
|
sortedBy: [NSSortDescriptor(keyPath: \InstalledApp.expirationDate, ascending: true)],
|
||||||
@@ -206,15 +206,15 @@ public extension InstalledApp
|
|||||||
#keyPath(InstalledApp.refreshedDate), date as NSDate,
|
#keyPath(InstalledApp.refreshedDate), date as NSDate,
|
||||||
#keyPath(InstalledApp.bundleIdentifier), StoreApp.altstoreAppID)
|
#keyPath(InstalledApp.bundleIdentifier), StoreApp.altstoreAppID)
|
||||||
|
|
||||||
if let patreonAccount = DatabaseManager.shared.patreonAccount(in: context), patreonAccount.isPatron, PatreonAPI.shared.isAuthenticated
|
// if let patreonAccount = DatabaseManager.shared.patreonAccount(in: context), patreonAccount.isPatron, PatreonAPI.shared.isAuthenticated
|
||||||
{
|
// {
|
||||||
// No additional predicate
|
// // No additional predicate
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [predicate,
|
// predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [predicate,
|
||||||
NSPredicate(format: "%K == nil OR %K == NO", #keyPath(InstalledApp.storeApp), #keyPath(InstalledApp.storeApp.isBeta))])
|
// NSPredicate(format: "%K == nil OR %K == NO", #keyPath(InstalledApp.storeApp), #keyPath(InstalledApp.storeApp.isBeta))])
|
||||||
}
|
// }
|
||||||
|
|
||||||
var installedApps = InstalledApp.all(satisfying: predicate,
|
var installedApps = InstalledApp.all(satisfying: predicate,
|
||||||
sortedBy: [NSSortDescriptor(keyPath: \InstalledApp.expirationDate, ascending: true)],
|
sortedBy: [NSSortDescriptor(keyPath: \InstalledApp.expirationDate, ascending: true)],
|
||||||
|
|||||||
@@ -52,15 +52,16 @@ public class PatreonAccount: NSManagedObject, Fetchable
|
|||||||
self.name = response.data.attributes.full_name
|
self.name = response.data.attributes.full_name
|
||||||
self.firstName = response.data.attributes.first_name
|
self.firstName = response.data.attributes.first_name
|
||||||
|
|
||||||
if let patronResponse = response.included?.first
|
// if let patronResponse = response.included?.first
|
||||||
{
|
// {
|
||||||
let patron = Patron(response: patronResponse)
|
// let patron = Patron(response: patronResponse)
|
||||||
self.isPatron = (patron.status == .active)
|
// self.isPatron = (patron.status == .active)
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
self.isPatron = false
|
// self.isPatron = false
|
||||||
}
|
// }
|
||||||
|
self.isPatron = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ public extension PatreonAPI
|
|||||||
if let context = account.managedObjectContext, !account.isPatron
|
if let context = account.managedObjectContext, !account.isPatron
|
||||||
{
|
{
|
||||||
// Deactivate all beta apps now that we're no longer a patron.
|
// Deactivate all beta apps now that we're no longer a patron.
|
||||||
self.deactivateBetaApps(in: context)
|
//self.deactivateBetaApps(in: context)
|
||||||
}
|
}
|
||||||
|
|
||||||
try account.managedObjectContext?.save()
|
try account.managedObjectContext?.save()
|
||||||
|
|||||||
Reference in New Issue
Block a user