mirror of
https://github.com/Ferrite-iOS/Ferrite.git
synced 2026-04-21 00:42:07 +00:00
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] {
|
public func fetchInstalledSources(searchResultsEmpty: Bool) -> [Source] {
|
||||||
let backgroundContext = PersistenceController.shared.backgroundContext
|
let backgroundContext = PersistenceController.shared.backgroundContext
|
||||||
|
|
||||||
if !filteredInstalledSources.isEmpty && !searchResultsEmpty {
|
if !filteredInstalledSources.isEmpty, !searchResultsEmpty {
|
||||||
return Array(filteredInstalledSources)
|
return Array(filteredInstalledSources)
|
||||||
} else if let sources = try? backgroundContext.fetch(Source.fetchRequest()) {
|
} else if let sources = try? backgroundContext.fetch(Source.fetchRequest()) {
|
||||||
return sources.compactMap { $0 }
|
return sources.compactMap { $0 }
|
||||||
|
|
|
||||||
|
|
@ -510,7 +510,7 @@ class ScrapingViewModel: ObservableObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return if a title doesn't exist
|
// 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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -531,7 +531,7 @@ class ScrapingViewModel: ObservableObject {
|
||||||
|
|
||||||
// Return if a magnet hash doesn't exist
|
// Return if a magnet hash doesn't exist
|
||||||
let magnet = Magnet(hash: magnetHash, link: link, title: title, trackers: source.trackers)
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
struct FilterAmountLabelView: View {
|
struct FilterAmountLabelView: View {
|
||||||
@Environment (\.colorScheme) var colorScheme
|
@Environment(\.colorScheme) var colorScheme
|
||||||
|
|
||||||
var amount: Int
|
var amount: Int
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ struct SearchFilterHeaderView: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
Divider()
|
Divider()
|
||||||
.frame(width:2, height: 20)
|
.frame(width: 2, height: 20)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Source filter picker
|
// MARK: - Source filter picker
|
||||||
|
|
|
||||||
|
|
@ -24,15 +24,15 @@ struct SearchResultsView: View {
|
||||||
ForEach(
|
ForEach(
|
||||||
scrapingModel.searchResults.sorted {
|
scrapingModel.searchResults.sorted {
|
||||||
navModel.compareSearchResult(lhs: $0, rhs: $1)
|
navModel.compareSearchResult(lhs: $0, rhs: $1)
|
||||||
}
|
},
|
||||||
, id: \.self
|
id: \.self
|
||||||
) { result in
|
) { result in
|
||||||
let debridIAStatus = debridManager.matchMagnetHash(result.magnet)
|
let debridIAStatus = debridManager.matchMagnetHash(result.magnet)
|
||||||
if
|
if
|
||||||
(pluginManager.filteredInstalledSources.isEmpty ||
|
pluginManager.filteredInstalledSources.isEmpty ||
|
||||||
pluginManager.filteredInstalledSources.contains(where: { result.source == $0.name })) &&
|
pluginManager.filteredInstalledSources.contains(where: { result.source == $0.name }),
|
||||||
(debridManager.filteredIAStatus.isEmpty ||
|
debridManager.filteredIAStatus.isEmpty ||
|
||||||
debridManager.filteredIAStatus.contains(debridIAStatus))
|
debridManager.filteredIAStatus.contains(debridIAStatus)
|
||||||
{
|
{
|
||||||
SearchResultButtonView(result: result)
|
SearchResultButtonView(result: result)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue