Ferrite-backup/Ferrite/Views/ComponentViews/Source/Buttons/SourceUpdateButtonView.swift
kingbri 2322d3af67 Debrid: Decentralize and add AllDebrid support
AllDebrid is another debrid provider. Add support to Ferrite in
addition to RealDebrid.

The overall debrid login backend has changed to accomodate for a more
agnostic app structure where more services can be added as needed.

Also add some cosmetic changes to search so filters can be added while
searching for a phrase.

Signed-off-by: kingbri <bdashore3@proton.me>
2022-11-27 18:18:09 -05:00

38 lines
920 B
Swift

//
// SourceUpdateButtonView.swift
// Ferrite
//
// Created by Brian Dashore on 8/5/22.
//
import SwiftUI
struct SourceUpdateButtonView: View {
@EnvironmentObject var sourceManager: SourceManager
let updatedSource: SourceJson
var body: some View {
HStack {
VStack(alignment: .leading, spacing: 5) {
HStack {
Text(updatedSource.name)
Text("v\(updatedSource.version)")
.foregroundColor(.secondary)
}
Text("by \(updatedSource.author ?? "Unknown")")
.foregroundColor(.secondary)
}
.padding(.vertical, 2)
Spacer()
Button("Update") {
Task {
await sourceManager.installSource(sourceJson: updatedSource, doUpsert: true)
}
}
}
}
}