Ferrite: Format

Signed-off-by: kingbri <bdashore3@gmail.com>
This commit is contained in:
kingbri 2022-07-26 11:07:01 -04:00
parent 119a3a18b1
commit 9d5a0d0120
10 changed files with 35 additions and 50 deletions

View file

@ -146,7 +146,7 @@ public class RealDebrid: ObservableObject {
keychain.set(rawResponse.accessToken, forKey: "RealDebrid.AccessToken")
keychain.set(rawResponse.refreshToken, forKey: "RealDebrid.RefreshToken")
let accessTimestamp = Date().timeIntervalSince1970 + (Double(rawResponse.expiresIn))
let accessTimestamp = Date().timeIntervalSince1970 + Double(rawResponse.expiresIn)
UserDefaults.standard.set(accessTimestamp, forKey: "RealDebrid.AccessTokenStamp")
// Set AppStorage variable

View file

@ -6,10 +6,8 @@
//
//
import Foundation
import CoreData
import Foundation
@objc(TorrentSource)
public class TorrentSource: NSManagedObject {
}
public class TorrentSource: NSManagedObject {}

View file

@ -6,26 +6,21 @@
//
//
import Foundation
import CoreData
import Foundation
extension TorrentSource {
@nonobjc public class func fetchRequest() -> NSFetchRequest<TorrentSource> {
return NSFetchRequest<TorrentSource>(entityName: "TorrentSource")
public extension TorrentSource {
@nonobjc class func fetchRequest() -> NSFetchRequest<TorrentSource> {
NSFetchRequest<TorrentSource>(entityName: "TorrentSource")
}
@NSManaged public var enabled: Bool
@NSManaged public var linkQuery: String
@NSManaged public var name: String?
@NSManaged public var rowQuery: String
@NSManaged public var sizeQuery: String?
@NSManaged public var titleQuery: String?
@NSManaged public var url: String
@NSManaged var enabled: Bool
@NSManaged var linkQuery: String
@NSManaged var name: String?
@NSManaged var rowQuery: String
@NSManaged var sizeQuery: String?
@NSManaged var titleQuery: String?
@NSManaged var url: String
}
extension TorrentSource : Identifiable {
}
extension TorrentSource: Identifiable {}

View file

@ -6,10 +6,8 @@
//
//
import Foundation
import CoreData
import Foundation
@objc(TorrentSourceUrl)
public class TorrentSourceUrl: NSManagedObject {
}
public class TorrentSourceUrl: NSManagedObject {}

View file

@ -6,22 +6,17 @@
//
//
import Foundation
import CoreData
import Foundation
extension TorrentSourceUrl {
@nonobjc public class func fetchRequest() -> NSFetchRequest<TorrentSourceUrl> {
return NSFetchRequest<TorrentSourceUrl>(entityName: "TorrentSourceUrl")
public extension TorrentSourceUrl {
@nonobjc class func fetchRequest() -> NSFetchRequest<TorrentSourceUrl> {
NSFetchRequest<TorrentSourceUrl>(entityName: "TorrentSourceUrl")
}
@NSManaged public var urlString: String
@NSManaged public var repoName: String?
@NSManaged public var repoAuthor: String?
@NSManaged var urlString: String
@NSManaged var repoName: String?
@NSManaged var repoAuthor: String?
}
extension TorrentSourceUrl : Identifiable {
}
extension TorrentSourceUrl: Identifiable {}

View file

@ -15,7 +15,7 @@ public struct SourceJson: Codable {
enum CodingKeys: String, CodingKey {
case repoName = "name"
case repoAuthor = "author"
case sources = "sources"
case sources
}
}

View file

@ -68,7 +68,7 @@ public class SourceManager: ObservableObject {
do {
try backgroundContext.save()
} catch {
Task{ @MainActor in
Task { @MainActor in
toastModel?.toastDescription = error.localizedDescription
}
}

View file

@ -37,7 +37,7 @@ struct ContentView: View {
} label: {
Text("None")
if (selectedSource == nil) {
if selectedSource == nil {
Image(systemName: "checkmark")
}
}
@ -79,9 +79,7 @@ struct ContentView: View {
}
}
func performSearch() {
}
func performSearch() {}
}
struct ContentView_Previews: PreviewProvider {

View file

@ -52,7 +52,7 @@ struct SearchResultsView: View {
}
.tint(.primary)
.padding(.bottom, 5)
SearchResultRDView(result: result)
}
}

View file

@ -30,8 +30,9 @@ struct SourceListView: View {
set: {
source.enabled = $0
PersistenceController.shared.save()
})) {
Text(source.name ?? "Unknown Source")
}
)) {
Text(source.name ?? "Unknown Source")
}
}
.onDelete { offsets in
@ -52,9 +53,9 @@ struct SourceListView: View {
if !sources.contains(where: { availableSource.name == $0.name }) {
HStack {
Text(availableSource.name ?? "Unnamed source")
Spacer()
Button("Install") {
sourceManager.installSource(sourceJson: availableSource)
}