From 9fa2295e947ca2eedaa3b62cf7935a9f743ee6bc Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Wed, 20 May 2026 09:50:12 -0600 Subject: [PATCH] Remove back-compat constructor for AnimeSearchResponse This is in preparation to remove the use of EnumSet for `dubStatus`. Those that use the builder, use `addDubStatus` which means we can easily do this without breaking bytecode compatibility, but first we need to remove the back-compat constructor, as once we do that it wouldn't work anymore anyway. --- .../com/lagradost/cloudstream3/MainAPI.kt | 38 +------------------ 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/MainAPI.kt b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/MainAPI.kt index c590165a1ad..eadb7783800 100644 --- a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/MainAPI.kt +++ b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/MainAPI.kt @@ -1497,43 +1497,7 @@ constructor( override var quality: SearchQuality? = null, override var posterHeaders: Map? = null, override var score: Score? = null, -) : SearchResponse { - @Suppress("DEPRECATION_ERROR") - @Deprecated( - "Use newAnimeSearchResponse", - level = DeprecationLevel.ERROR - ) - constructor( - name: String, - url: String, - apiName: String, - type: TvType? = null, - - posterUrl: String? = null, - year: Int? = null, - dubStatus: EnumSet? = null, - - otherName: String? = null, - episodes: MutableMap = mutableMapOf(), - - id: Int? = null, - quality: SearchQuality? = null, - posterHeaders: Map? = null, - ) : this( - name, - url, - apiName, - type, - posterUrl, - year, - dubStatus, - otherName, - episodes, - id, - quality, - posterHeaders, null - ) -} +) : SearchResponse fun AnimeSearchResponse.addDubStatus(status: DubStatus, episodes: Int? = null) { this.dubStatus = dubStatus?.also { it.add(status) } ?: EnumSet.of(status)