Skip to content

Commit

Permalink
Ferrite: Format
Browse files Browse the repository at this point in the history
Signed-off-by: kingbri <[email protected]>
  • Loading branch information
kingbri1 committed Apr 23, 2023
1 parent 76a0262 commit 9e362c1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Ferrite/ViewModels/PluginManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
4 changes: 2 additions & 2 deletions Ferrite/ViewModels/ScrapingViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import SwiftUI

struct FilterAmountLabelView: View {
@Environment (\.colorScheme) var colorScheme
@Environment(\.colorScheme) var colorScheme

var amount: Int

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct SearchFilterHeaderView: View {
}

Divider()
.frame(width:2, height: 20)
.frame(width: 2, height: 20)
}

// MARK: - Source filter picker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 9e362c1

Please sign in to comment.