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:
kingbri 2024-06-06 10:46:18 -04:00
parent 91f124130c
commit 40b323bd56
2 changed files with 1 additions and 40 deletions

View file

@ -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

View file

@ -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)
}