From 613f567811bfddac7538fed16758df5973d39ad7 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Thu, 4 Jun 2026 11:34:13 -0600 Subject: [PATCH 1/2] CloudStreamPackage: migrate to kotlinx serialization --- .../actions/temp/CloudStreamPackage.kt | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/actions/temp/CloudStreamPackage.kt b/app/src/main/java/com/lagradost/cloudstream3/actions/temp/CloudStreamPackage.kt index d414b611783..b4832ac0d0e 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/actions/temp/CloudStreamPackage.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/actions/temp/CloudStreamPackage.kt @@ -4,7 +4,6 @@ import android.app.Activity import android.content.Context import android.content.Intent import android.net.Uri -import com.fasterxml.jackson.annotation.JsonProperty import com.lagradost.cloudstream3.actions.OpenInAppAction import com.lagradost.cloudstream3.BuildConfig import com.lagradost.cloudstream3.ui.player.ExtractorUri @@ -22,7 +21,10 @@ import com.lagradost.cloudstream3.utils.newExtractorLink import com.lagradost.cloudstream3.utils.Qualities import com.lagradost.cloudstream3.utils.SubtitleHelper.fromCodeToLangTagIETF import com.lagradost.cloudstream3.utils.SubtitleHelper.fromLanguageToTagIETF +import com.lagradost.cloudstream3.utils.serializer.UriSerializer import com.lagradost.cloudstream3.utils.txt +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable /** * If you want to support CloudStream 3 as an external player, then this shows how to play any video link @@ -49,18 +51,20 @@ class CloudStreamPackage : OpenInAppAction( const val DURATION_EXTRA: String = "dur" // Duration time in MS (Long) } + @Serializable data class MinimalVideoLink( - @JsonProperty("uri") + @SerialName("uri") + @Serializable(with = UriSerializer::class) val uri: Uri?, - @JsonProperty("url") + @SerialName("url") val url: String?, - @JsonProperty("mimeType") + @SerialName("mimeType") val mimeType: String = "video/mp4", - @JsonProperty("name") + @SerialName("name") val name: String?, - @JsonProperty("headers") + @SerialName("headers") var headers: Map = mapOf(), - @JsonProperty("quality") + @SerialName("quality") val quality: Int?, ) { companion object { @@ -97,15 +101,15 @@ class CloudStreamPackage : OpenInAppAction( } } - + @Serializable data class MinimalSubtitleLink( - @JsonProperty("url") + @SerialName("url") val url: String, - @JsonProperty("mimeType") + @SerialName("mimeType") val mimeType: String = "text/vtt", - @JsonProperty("name") + @SerialName("name") val name: String?, - @JsonProperty("headers") + @SerialName("headers") var headers: Map = mapOf(), ) { companion object { @@ -159,4 +163,4 @@ class CloudStreamPackage : OpenInAppAction( override fun onResult(activity: Activity, intent: Intent?) { // No results yet } -} \ No newline at end of file +} From 23ee4d489a04b41cbc08b47843db7e1eb5fdd07f Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Thu, 4 Jun 2026 11:42:13 -0600 Subject: [PATCH 2/2] Fix import --- .../lagradost/cloudstream3/actions/temp/CloudStreamPackage.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/actions/temp/CloudStreamPackage.kt b/app/src/main/java/com/lagradost/cloudstream3/actions/temp/CloudStreamPackage.kt index b4832ac0d0e..1e1d4863741 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/actions/temp/CloudStreamPackage.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/actions/temp/CloudStreamPackage.kt @@ -21,7 +21,7 @@ import com.lagradost.cloudstream3.utils.newExtractorLink import com.lagradost.cloudstream3.utils.Qualities import com.lagradost.cloudstream3.utils.SubtitleHelper.fromCodeToLangTagIETF import com.lagradost.cloudstream3.utils.SubtitleHelper.fromLanguageToTagIETF -import com.lagradost.cloudstream3.utils.serializer.UriSerializer +import com.lagradost.cloudstream3.utils.serializers.UriSerializer import com.lagradost.cloudstream3.utils.txt import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable