mirror of
https://github.com/Ferrite-iOS/Ferrite.git
synced 2026-04-21 08:52:00 +00:00
Debrid: Add description field and cleanup
Allow for overriding of the default description in the settings UI. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
parent
0d39fd481a
commit
c5a08cc725
5 changed files with 24 additions and 7 deletions
|
|
@ -14,9 +14,12 @@ import Foundation
|
||||||
// Delete torrent (website URL, not API URL): /cloud/remove/\(torrentId)
|
// Delete torrent (website URL, not API URL): /cloud/remove/\(torrentId)
|
||||||
|
|
||||||
class OffCloud: DebridSource, ObservableObject {
|
class OffCloud: DebridSource, ObservableObject {
|
||||||
var id: String = "OffCloud"
|
let id = "OffCloud"
|
||||||
var abbreviation: String = "OC"
|
let abbreviation = "OC"
|
||||||
var website: String = "https://offcloud.com"
|
let website = "https://offcloud.com"
|
||||||
|
let description = "OffCloud is a debrid service that is used for downloads and media playback. " +
|
||||||
|
"You must pay to access this service. \n\n" +
|
||||||
|
"This service does not inform if a torrent is a batch before downloading."
|
||||||
|
|
||||||
@Published var authProcessing: Bool = false
|
@Published var authProcessing: Bool = false
|
||||||
var isLoggedIn: Bool {
|
var isLoggedIn: Bool {
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@ class Premiumize: OAuthDebridSource, ObservableObject {
|
||||||
let id = "Premiumize"
|
let id = "Premiumize"
|
||||||
let abbreviation = "PM"
|
let abbreviation = "PM"
|
||||||
let website = "https://premiumize.me"
|
let website = "https://premiumize.me"
|
||||||
|
let description = "Premiumize is a debrid service that is used for downloads and media playback with seeding. " +
|
||||||
|
"You must pay to access the service."
|
||||||
|
|
||||||
@Published var authProcessing: Bool = false
|
@Published var authProcessing: Bool = false
|
||||||
var isLoggedIn: Bool {
|
var isLoggedIn: Bool {
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,12 @@ import Foundation
|
||||||
// Unrestrict: /torrents/requestdl
|
// Unrestrict: /torrents/requestdl
|
||||||
|
|
||||||
class TorBox: DebridSource, ObservableObject {
|
class TorBox: DebridSource, ObservableObject {
|
||||||
var id: String = "TorBox"
|
let id = "TorBox"
|
||||||
var abbreviation: String = "TB"
|
let abbreviation = "TB"
|
||||||
var website: String = "https://torbox.app"
|
let website = "https://torbox.app"
|
||||||
|
let description = "TorBox is a debrid service that is used for downloads and media playback with seeding. " +
|
||||||
|
"Both free and paid plans are available. \n\n" +
|
||||||
|
"This service does not inform if a torrent is a batch before downloading."
|
||||||
|
|
||||||
@Published var authProcessing: Bool = false
|
@Published var authProcessing: Bool = false
|
||||||
var isLoggedIn: Bool {
|
var isLoggedIn: Bool {
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ protocol DebridSource: AnyObservableObject {
|
||||||
var id: String { get }
|
var id: String { get }
|
||||||
var abbreviation: String { get }
|
var abbreviation: String { get }
|
||||||
var website: String { get }
|
var website: String { get }
|
||||||
|
var description: String? { get }
|
||||||
|
|
||||||
// Auth variables
|
// Auth variables
|
||||||
var authProcessing: Bool { get set }
|
var authProcessing: Bool { get set }
|
||||||
|
|
@ -54,6 +55,12 @@ protocol DebridSource: AnyObservableObject {
|
||||||
func deleteTorrent(torrentId: String?) async throws
|
func deleteTorrent(torrentId: String?) async throws
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension DebridSource {
|
||||||
|
var description: String? {
|
||||||
|
nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protocol PollingDebridSource: DebridSource {
|
protocol PollingDebridSource: DebridSource {
|
||||||
// Task reference for polling
|
// Task reference for polling
|
||||||
var authTask: Task<Void, Error>? { get set }
|
var authTask: Task<Void, Error>? { get set }
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,9 @@ struct SettingsDebridInfoView: View {
|
||||||
List {
|
List {
|
||||||
Section(header: InlineHeader("Description")) {
|
Section(header: InlineHeader("Description")) {
|
||||||
VStack(alignment: .leading, spacing: 10) {
|
VStack(alignment: .leading, spacing: 10) {
|
||||||
Text("\(debridSource.id) is a debrid service that is used for unrestricting downloads and media playback. You must pay to access the service.")
|
Text(debridSource.description ??
|
||||||
|
"\(debridSource.id) is a debrid service that is used for downloads and media playback. You must pay to access the service."
|
||||||
|
)
|
||||||
|
|
||||||
Link("Website", destination: URL(string: debridSource.website) ?? URL(string: "https://kingbri.dev/ferrite")!)
|
Link("Website", destination: URL(string: debridSource.website) ?? URL(string: "https://kingbri.dev/ferrite")!)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue