Ferrite: Format
Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
parent
76a0262a14
commit
9e362c14b7
5 changed files with 11 additions and 11 deletions
|
|
@ -269,7 +269,7 @@ public class PluginManager: ObservableObject {
|
|||
public func fetchInstalledSources(searchResultsEmpty: Bool) -> [Source] {
|
||||
let backgroundContext = PersistenceController.shared.backgroundContext
|
||||
|
||||
if !filteredInstalledSources.isEmpty && !searchResultsEmpty {
|
||||
if !filteredInstalledSources.isEmpty, !searchResultsEmpty {
|
||||
return Array(filteredInstalledSources)
|
||||
} else if let sources = try? backgroundContext.fetch(Source.fetchRequest()) {
|
||||
return sources.compactMap { $0 }
|
||||
|
|
|
|||
|
|
@ -510,7 +510,7 @@ class ScrapingViewModel: ObservableObject {
|
|||
}
|
||||
|
||||
// Return if a title doesn't exist
|
||||
if title == nil && (jsonParser.subResults == nil && existingSearchResult == nil) {
|
||||
if title == nil, jsonParser.subResults == nil, existingSearchResult == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -531,7 +531,7 @@ class ScrapingViewModel: ObservableObject {
|
|||
|
||||
// Return if a magnet hash doesn't exist
|
||||
let magnet = Magnet(hash: magnetHash, link: link, title: title, trackers: source.trackers)
|
||||
if magnet.hash == nil && (jsonParser.subResults == nil && existingSearchResult == nil) {
|
||||
if magnet.hash == nil, jsonParser.subResults == nil, existingSearchResult == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
import SwiftUI
|
||||
|
||||
struct FilterAmountLabelView: View {
|
||||
@Environment (\.colorScheme) var colorScheme
|
||||
@Environment(\.colorScheme) var colorScheme
|
||||
|
||||
var amount: Int
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ struct SearchFilterHeaderView: View {
|
|||
}
|
||||
|
||||
Divider()
|
||||
.frame(width:2, height: 20)
|
||||
.frame(width: 2, height: 20)
|
||||
}
|
||||
|
||||
// MARK: - Source filter picker
|
||||
|
|
|
|||
|
|
@ -24,15 +24,15 @@ struct SearchResultsView: View {
|
|||
ForEach(
|
||||
scrapingModel.searchResults.sorted {
|
||||
navModel.compareSearchResult(lhs: $0, rhs: $1)
|
||||
}
|
||||
, id: \.self
|
||||
},
|
||||
id: \.self
|
||||
) { result in
|
||||
let debridIAStatus = debridManager.matchMagnetHash(result.magnet)
|
||||
if
|
||||
(pluginManager.filteredInstalledSources.isEmpty ||
|
||||
pluginManager.filteredInstalledSources.contains(where: { result.source == $0.name })) &&
|
||||
(debridManager.filteredIAStatus.isEmpty ||
|
||||
debridManager.filteredIAStatus.contains(debridIAStatus))
|
||||
pluginManager.filteredInstalledSources.isEmpty ||
|
||||
pluginManager.filteredInstalledSources.contains(where: { result.source == $0.name }),
|
||||
debridManager.filteredIAStatus.isEmpty ||
|
||||
debridManager.filteredIAStatus.contains(debridIAStatus)
|
||||
{
|
||||
SearchResultButtonView(result: result)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue