From e3c31a99926ea3ae320fe076d6df825559029aa1 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Fri, 1 May 2026 11:00:43 -0600 Subject: [PATCH] Remove two easy-to-replace methods deprecated for over a year --- .../cloudstream3/mvvm/ArchComponentExt.kt | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/mvvm/ArchComponentExt.kt b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/mvvm/ArchComponentExt.kt index e13bcf5ec65..cf28bf4c05c 100644 --- a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/mvvm/ArchComponentExt.kt +++ b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/mvvm/ArchComponentExt.kt @@ -76,20 +76,6 @@ fun logError(throwable: Throwable) { Log.d("ApiError", "-------------------------------------------------------------------") } -@Deprecated( - "Outdated function, use `safe` instead", - replaceWith = ReplaceWith("safe"), - level = DeprecationLevel.ERROR -) -fun normalSafeApiCall(apiCall: () -> T): T? { - return try { - apiCall.invoke() - } catch (throwable: Throwable) { - logError(throwable) - return null - } -} - /** Catches any exception (or error) and only logs it. * Will return null on exceptions. */ fun safe(apiCall: () -> T): T? { @@ -112,20 +98,6 @@ suspend fun safeAsync(apiCall: suspend () -> T): T? { } } -@Deprecated( - "Outdated function, use `safeAsync` instead", - replaceWith = ReplaceWith("safeAsync"), - level = DeprecationLevel.ERROR -) -suspend fun suspendSafeApiCall(apiCall: suspend () -> T): T? { - return try { - apiCall.invoke() - } catch (throwable: Throwable) { - logError(throwable) - return null - } -} - fun Throwable.getAllMessages(): String { return (this.localizedMessage ?: "") + (this.cause?.getAllMessages()?.let { "\n$it" } ?: "") }