Magnets are expressed in two different ways: a hash and a link. Both of these mean the same thing with a magnet link giving more information if required. However, there was a disconnect if a hash was present or a link was present and required many steps to check which was available. Unify magnets by creating a parent structure that attempts to extract the hash or create a link in the event that either parameter isn't provided. Replace everything except bookmarks (to prevent CoreData complaints and unnecessary abstraction) to use the new Magnet system. Signed-off-by: kingbri <bdashore3@proton.me>
37 lines
705 B
Swift
37 lines
705 B
Swift
//
|
|
// SearchResultRDView.swift
|
|
// Ferrite
|
|
//
|
|
// Created by Brian Dashore on 7/26/22.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct SearchResultInfoView: View {
|
|
@EnvironmentObject var debridManager: DebridManager
|
|
|
|
var result: SearchResult
|
|
|
|
var body: some View {
|
|
HStack {
|
|
Text(result.source)
|
|
|
|
Spacer()
|
|
|
|
if let seeders = result.seeders {
|
|
Text("S: \(seeders)")
|
|
}
|
|
|
|
if let leechers = result.leechers {
|
|
Text("L: \(leechers)")
|
|
}
|
|
|
|
if let size = result.size {
|
|
Text(size)
|
|
}
|
|
|
|
DebridLabelView(magnet: result.magnet)
|
|
}
|
|
.font(.caption)
|
|
}
|
|
}
|