mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-20 04:03:26 +01:00
Removes unnecessary StoreApp convenience properties as well as fix other issues
This commit is contained in:
@@ -32,7 +32,6 @@ final class DownloadAppOperation: ResultOperation<ALTApplication>
|
|||||||
|
|
||||||
self.appName = app.name
|
self.appName = app.name
|
||||||
self.bundleIdentifier = app.bundleIdentifier
|
self.bundleIdentifier = app.bundleIdentifier
|
||||||
self.sourceURL = app.url
|
|
||||||
self.destinationURL = destinationURL
|
self.destinationURL = destinationURL
|
||||||
|
|
||||||
super.init()
|
super.init()
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ extension VerificationError
|
|||||||
VerificationError(code: .mismatchedBundleIdentifiers, app: app, sourceBundleID: sourceBundleID)
|
VerificationError(code: .mismatchedBundleIdentifiers, app: app, sourceBundleID: sourceBundleID)
|
||||||
}
|
}
|
||||||
|
|
||||||
static func iOSVersionNotSupported(app: ALTApplication, osVersion: OperatingSystemVersion = ProcessInfo.processInfo.operatingSystemVersion, requiredOSVersion: OperatingSystemVersion?) -> VerificationError {
|
static func iOSVersionNotSupported(app: AppProtocol, osVersion: OperatingSystemVersion = ProcessInfo.processInfo.operatingSystemVersion, requiredOSVersion: OperatingSystemVersion?) -> VerificationError {
|
||||||
VerificationError(code: .iOSVersionNotSupported, app: app)
|
VerificationError(code: .iOSVersionNotSupported, app: app)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ struct Managed<ManagedObject>
|
|||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
// Optionals
|
// Optionals
|
||||||
subscript<Wrapped, T>(dynamicMember keyPath: KeyPath<Wrapped, T>) -> T? where ManagedObject == Optional<Wrapped> {
|
subscript<Wrapped, T>(dynamicMember keyPath: KeyPath<Wrapped, T>) -> T? where ManagedObject == Optional<Wrapped> {
|
||||||
var result: T?
|
var result: T?
|
||||||
|
|||||||
@@ -62,14 +62,14 @@ public class InstalledApp: NSManagedObject, InstalledAppProtocol
|
|||||||
|
|
||||||
@objc public var hasUpdate: Bool {
|
@objc public var hasUpdate: Bool {
|
||||||
if self.storeApp == nil { return false }
|
if self.storeApp == nil { return false }
|
||||||
if self.storeApp!.latestVersion == nil { return false }
|
if self.storeApp!.latestSupportedVersion == nil { return false }
|
||||||
|
|
||||||
let currentVersion = SemanticVersion(self.version)
|
let currentVersion = SemanticVersion(self.version)
|
||||||
let latestVersion = SemanticVersion(self.storeApp!.latestVersion!.version)
|
let latestVersion = SemanticVersion(self.storeApp!.latestSupportedVersion!.version)
|
||||||
|
|
||||||
if currentVersion == nil || latestVersion == nil {
|
if currentVersion == nil || latestVersion == nil {
|
||||||
// One of the versions is not valid SemVer, fall back to comparing the version strings by character
|
// One of the versions is not valid SemVer, fall back to comparing the version strings by character
|
||||||
return self.version < self.storeApp!.latestVersion!.version
|
return self.version < self.storeApp!.latestSupportedVersion!.version
|
||||||
}
|
}
|
||||||
|
|
||||||
return currentVersion! < latestVersion!
|
return currentVersion! < latestVersion!
|
||||||
|
|||||||
Reference in New Issue
Block a user