From 94f0dbecdb4bf21b2194b20dc2d616b64daa11b0 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Thu, 18 Jun 2026 13:52:22 -0600 Subject: [PATCH 1/2] Keep all JsonProperty for now --- .../ui/subtitles/ChromecastSubtitlesFragment.kt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/subtitles/ChromecastSubtitlesFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/subtitles/ChromecastSubtitlesFragment.kt index da3665b9474..95ef264f879 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/subtitles/ChromecastSubtitlesFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/subtitles/ChromecastSubtitlesFragment.kt @@ -13,6 +13,7 @@ import android.widget.Toast import androidx.annotation.OptIn import androidx.media3.common.text.Cue import androidx.media3.common.util.UnstableApi +import com.fasterxml.jackson.annotation.JsonProperty import com.google.android.gms.cast.TextTrackStyle.EDGE_TYPE_DEPRESSED import com.google.android.gms.cast.TextTrackStyle.EDGE_TYPE_DROP_SHADOW import com.google.android.gms.cast.TextTrackStyle.EDGE_TYPE_NONE @@ -44,14 +45,14 @@ const val CHROME_SUBTITLE_KEY = "chome_subtitle_settings" @Serializable data class SaveChromeCaptionStyle( - @SerialName("fontFamily") var fontFamily: String? = null, - @SerialName("fontGenericFamily") var fontGenericFamily: Int? = null, - @SerialName("backgroundColor") var backgroundColor: Int = 0x00FFFFFF, // transparent - @SerialName("edgeColor") var edgeColor: Int = Color.BLACK, // BLACK - @SerialName("edgeType") var edgeType: Int = EDGE_TYPE_OUTLINE, - @SerialName("foregroundColor") var foregroundColor: Int = Color.WHITE, - @SerialName("fontScale") var fontScale: Float = 1.05f, - @SerialName("windowColor") var windowColor: Int = Color.TRANSPARENT, + @JsonProperty("fontFamily") @SerialName("fontFamily") var fontFamily: String? = null, + @JsonProperty("fontGenericFamily") @SerialName("fontGenericFamily") var fontGenericFamily: Int? = null, + @JsonProperty("backgroundColor") @SerialName("backgroundColor") var backgroundColor: Int = 0x00FFFFFF, // transparent + @JsonProperty("edgeColor") @SerialName("edgeColor") var edgeColor: Int = Color.BLACK, // BLACK + @JsonProperty("edgeType") @SerialName("edgeType") var edgeType: Int = EDGE_TYPE_OUTLINE, + @JsonProperty("foregroundColor") @SerialName("foregroundColor") var foregroundColor: Int = Color.WHITE, + @JsonProperty("fontScale") @SerialName("fontScale") var fontScale: Float = 1.05f, + @JsonProperty("windowColor") @SerialName("windowColor") var windowColor: Int = Color.TRANSPARENT, ) class ChromecastSubtitlesFragment : BaseFragment( From 09c092d4a966d3052871a7eaaf3278a2a48ba821 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Thu, 18 Jun 2026 13:55:41 -0600 Subject: [PATCH 2/2] Keep all JsonProperty for now --- .../ui/subtitles/SubtitlesFragment.kt | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/subtitles/SubtitlesFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/subtitles/SubtitlesFragment.kt index f07b2731cfc..860cb4fcbe0 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/subtitles/SubtitlesFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/subtitles/SubtitlesFragment.kt @@ -25,6 +25,7 @@ import androidx.media3.common.util.UnstableApi import androidx.media3.ui.CaptionStyleCompat import androidx.media3.ui.SubtitleView import androidx.preference.PreferenceManager +import com.fasterxml.jackson.annotation.JsonProperty import com.jaredrummler.android.colorpicker.ColorPickerDialog import com.lagradost.cloudstream3.CloudStreamApp.Companion.getKey import com.lagradost.cloudstream3.CloudStreamApp.Companion.setKey @@ -63,29 +64,29 @@ const val SUBTITLE_DOWNLOAD_KEY = "subs_auto_download" @Serializable data class SaveCaptionStyle( - @SerialName("foregroundColor") var foregroundColor: Int, - @SerialName("backgroundColor") var backgroundColor: Int, - @SerialName("windowColor") var windowColor: Int, + @JsonProperty("foregroundColor") @SerialName("foregroundColor") var foregroundColor: Int, + @JsonProperty("backgroundColor") @SerialName("backgroundColor") var backgroundColor: Int, + @JsonProperty("windowColor") @SerialName("windowColor") var windowColor: Int, @OptIn(UnstableApi::class) - @SerialName("edgeType") var edgeType: @CaptionStyleCompat.EdgeType Int, - @SerialName("edgeColor") var edgeColor: Int, - @FontRes @SerialName("typeface") var typeface: Int?, - @SerialName("typefaceFilePath") var typefaceFilePath: String?, - @SerialName("elevation") var elevation: Int, // in dp - @SerialName("fixedTextSize") var fixedTextSize: Float?, // in sp - @Px @SerialName("edgeSize") var edgeSize: Float? = null, - @SerialName("removeCaptions") var removeCaptions: Boolean = false, - @SerialName("removeBloat") var removeBloat: Boolean = true, + @JsonProperty("edgeType") @SerialName("edgeType") var edgeType: @CaptionStyleCompat.EdgeType Int, + @JsonProperty("edgeColor") @SerialName("edgeColor") var edgeColor: Int, + @FontRes @JsonProperty("typeface") @SerialName("typeface") var typeface: Int?, + @JsonProperty("typefaceFilePath") @SerialName("typefaceFilePath") var typefaceFilePath: String?, + @JsonProperty("elevation") @SerialName("elevation") var elevation: Int, // in dp + @JsonProperty("fixedTextSize") @SerialName("fixedTextSize") var fixedTextSize: Float?, // in sp + @Px @JsonProperty("edgeSize") @SerialName("edgeSize") var edgeSize: Float? = null, + @JsonProperty("removeCaptions") @SerialName("removeCaptions") var removeCaptions: Boolean = false, + @JsonProperty("removeBloat") @SerialName("removeBloat") var removeBloat: Boolean = true, /** Apply caps lock to the text */ - @SerialName("upperCase") var upperCase: Boolean = false, + @JsonProperty("upperCase") @SerialName("upperCase") var upperCase: Boolean = false, /** Apply bold to the text */ - @SerialName("bold") var bold: Boolean = false, + @JsonProperty("bold") @SerialName("bold") var bold: Boolean = false, /** Apply italic to the text */ - @SerialName("italic") var italic: Boolean = false, + @JsonProperty("italic") @SerialName("italic") var italic: Boolean = false, /** in px, background radius, aka how round the background (backgroundColor) on each row is */ - @SerialName("backgroundRadius") var backgroundRadius: Float? = null, + @JsonProperty("backgroundRadius") @SerialName("backgroundRadius") var backgroundRadius: Float? = null, /** The SSA_ALIGNMENT */ - @SerialName("alignment") var alignment: Int? = null, + @JsonProperty("alignment") @SerialName("alignment") var alignment: Int? = null, ) const val DEF_SUBS_ELEVATION = 20