mirror of
https://github.com/Ferrite-iOS/Ferrite.git
synced 2026-01-11 20:10:27 +00:00
Debrid: Remove redundant logout functions
Logout is now handled in the debrid class itself. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
parent
91f124130c
commit
40b323bd56
2 changed files with 1 additions and 40 deletions
|
|
@ -404,45 +404,6 @@ public class DebridManager: ObservableObject {
|
|||
}
|
||||
}
|
||||
|
||||
// MARK: - Logout UI linked functions
|
||||
|
||||
// Common function to delegate what debrid service to logout of
|
||||
public func logoutDebrid(debridType: DebridType) async {
|
||||
switch debridType {
|
||||
case .realDebrid:
|
||||
await logoutRd()
|
||||
case .allDebrid:
|
||||
logoutAd()
|
||||
case .premiumize:
|
||||
logoutPm()
|
||||
}
|
||||
|
||||
// Automatically resets the preferred debrid service if it was set to the logged out service
|
||||
if selectedDebridType == debridType {
|
||||
selectedDebridType = nil
|
||||
}
|
||||
}
|
||||
|
||||
private func logoutRd() async {
|
||||
await realDebrid.logout()
|
||||
enabledDebrids.remove(.realDebrid)
|
||||
}
|
||||
|
||||
private func logoutAd() {
|
||||
allDebrid.logout()
|
||||
enabledDebrids.remove(.allDebrid)
|
||||
|
||||
logManager?.info(
|
||||
"AllDebrid: Logged out, API key needs to be removed",
|
||||
description: "Please manually delete the AllDebrid API key"
|
||||
)
|
||||
}
|
||||
|
||||
private func logoutPm() {
|
||||
premiumize.logout()
|
||||
enabledDebrids.remove(.premiumize)
|
||||
}
|
||||
|
||||
// MARK: - Debrid fetch UI linked functions
|
||||
|
||||
// Common function to delegate what debrid service to fetch from
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ struct SettingsDebridInfoView: View {
|
|||
Button {
|
||||
Task {
|
||||
if debridSource.isLoggedIn {
|
||||
//await debridManager.logoutDebrid(debridType: debridType)
|
||||
await debridSource.logout()
|
||||
} else if !debridSource.authProcessing {
|
||||
//await debridManager.authenticateDebrid(debridType: debridType, apiKey: nil)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue