From 35a1e06e19d75c32b66468783441736ce31b50f1 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Fri, 5 Jun 2026 16:22:04 -0600 Subject: [PATCH 1/2] SubSource: migrate to kotlinx serialization --- .../syncproviders/providers/SubSource.kt | 65 +++++++++++-------- 1 file changed, 37 insertions(+), 28 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/syncproviders/providers/SubSource.kt b/app/src/main/java/com/lagradost/cloudstream3/syncproviders/providers/SubSource.kt index 19122768e23..6e7a3545239 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/syncproviders/providers/SubSource.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/syncproviders/providers/SubSource.kt @@ -1,6 +1,5 @@ package com.lagradost.cloudstream3.syncproviders.providers -import com.fasterxml.jackson.annotation.JsonProperty import com.lagradost.cloudstream3.TvType import com.lagradost.cloudstream3.app import com.lagradost.cloudstream3.subtitles.AbstractSubtitleEntities @@ -10,6 +9,8 @@ import com.lagradost.cloudstream3.syncproviders.SubtitleAPI import com.lagradost.cloudstream3.utils.AppUtils.parseJson import com.lagradost.cloudstream3.utils.AppUtils.toJson import com.lagradost.cloudstream3.utils.SubtitleHelper +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable class SubSourceApi : SubtitleAPI() { override val name = "SubSource" @@ -115,53 +116,61 @@ class SubSourceApi : SubtitleAPI() { } } + @Serializable data class ApiSearch( - @JsonProperty("success") val success: Boolean, - @JsonProperty("found") val found: List, + @SerialName("success") val success: Boolean, + @SerialName("found") val found: List, ) + @Serializable data class Found( - @JsonProperty("id") val id: Long, - @JsonProperty("title") val title: String, - @JsonProperty("seasons") val seasons: Long, - @JsonProperty("type") val type: String, - @JsonProperty("releaseYear") val releaseYear: Long, - @JsonProperty("linkName") val linkName: String, + @SerialName("id") val id: Long, + @SerialName("title") val title: String, + @SerialName("seasons") val seasons: Long, + @SerialName("type") val type: String, + @SerialName("releaseYear") val releaseYear: Long, + @SerialName("linkName") val linkName: String, ) + @Serializable data class ApiResponse( - @JsonProperty("success") val success: Boolean, - @JsonProperty("movie") val movie: Movie, - @JsonProperty("subs") val subs: List, + @SerialName("success") val success: Boolean, + @SerialName("movie") val movie: Movie, + @SerialName("subs") val subs: List, ) + @Serializable data class Movie( - @JsonProperty("id") val id: Long? = null, - @JsonProperty("type") val type: String? = null, - @JsonProperty("year") val year: Long? = null, - @JsonProperty("fullName") val fullName: String? = null, + @SerialName("id") val id: Long? = null, + @SerialName("type") val type: String? = null, + @SerialName("year") val year: Long? = null, + @SerialName("fullName") val fullName: String? = null, ) + @Serializable data class Sub( - @JsonProperty("hi") val hi: Int? = null, - @JsonProperty("fullLink") val fullLink: String? = null, - @JsonProperty("linkName") val linkName: String? = null, - @JsonProperty("lang") val lang: String? = null, - @JsonProperty("releaseName") val releaseName: String? = null, - @JsonProperty("subId") val subId: Long? = null, + @SerialName("hi") val hi: Int? = null, + @SerialName("fullLink") val fullLink: String? = null, + @SerialName("linkName") val linkName: String? = null, + @SerialName("lang") val lang: String? = null, + @SerialName("releaseName") val releaseName: String? = null, + @SerialName("subId") val subId: Long? = null, ) + @Serializable data class SubData( - @JsonProperty("movie") val movie: String, - @JsonProperty("lang") val lang: String, - @JsonProperty("id") val id: String, + @SerialName("movie") val movie: String, + @SerialName("lang") val lang: String, + @SerialName("id") val id: String, ) + @Serializable data class SubTitleLink( - @JsonProperty("sub") val sub: SubToken, + @SerialName("sub") val sub: SubToken, ) + @Serializable data class SubToken( - @JsonProperty("downloadToken") val downloadToken: String, + @SerialName("downloadToken") val downloadToken: String, ) -} \ No newline at end of file +} From 1aadc8eff0c4caccabb2a803c814957e89072ddb Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Thu, 18 Jun 2026 12:44:24 -0600 Subject: [PATCH 2/2] Keep all JsonProperty for now --- .../syncproviders/providers/SubSource.kt | 53 ++++++++++--------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/syncproviders/providers/SubSource.kt b/app/src/main/java/com/lagradost/cloudstream3/syncproviders/providers/SubSource.kt index 6e7a3545239..fb463ebee77 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/syncproviders/providers/SubSource.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/syncproviders/providers/SubSource.kt @@ -1,5 +1,6 @@ package com.lagradost.cloudstream3.syncproviders.providers +import com.fasterxml.jackson.annotation.JsonProperty import com.lagradost.cloudstream3.TvType import com.lagradost.cloudstream3.app import com.lagradost.cloudstream3.subtitles.AbstractSubtitleEntities @@ -118,59 +119,59 @@ class SubSourceApi : SubtitleAPI() { @Serializable data class ApiSearch( - @SerialName("success") val success: Boolean, - @SerialName("found") val found: List, + @JsonProperty("success") @SerialName("success") val success: Boolean, + @JsonProperty("found") @SerialName("found") val found: List, ) @Serializable data class Found( - @SerialName("id") val id: Long, - @SerialName("title") val title: String, - @SerialName("seasons") val seasons: Long, - @SerialName("type") val type: String, - @SerialName("releaseYear") val releaseYear: Long, - @SerialName("linkName") val linkName: String, + @JsonProperty("id") @SerialName("id") val id: Long, + @JsonProperty("title") @SerialName("title") val title: String, + @JsonProperty("seasons") @SerialName("seasons") val seasons: Long, + @JsonProperty("type") @SerialName("type") val type: String, + @JsonProperty("releaseYear") @SerialName("releaseYear") val releaseYear: Long, + @JsonProperty("linkName") @SerialName("linkName") val linkName: String, ) @Serializable data class ApiResponse( - @SerialName("success") val success: Boolean, - @SerialName("movie") val movie: Movie, - @SerialName("subs") val subs: List, + @JsonProperty("success") @SerialName("success") val success: Boolean, + @JsonProperty("movie") @SerialName("movie") val movie: Movie, + @JsonProperty("subs") @SerialName("subs") val subs: List, ) @Serializable data class Movie( - @SerialName("id") val id: Long? = null, - @SerialName("type") val type: String? = null, - @SerialName("year") val year: Long? = null, - @SerialName("fullName") val fullName: String? = null, + @JsonProperty("id") @SerialName("id") val id: Long? = null, + @JsonProperty("type") @SerialName("type") val type: String? = null, + @JsonProperty("year") @SerialName("year") val year: Long? = null, + @JsonProperty("fullName") @SerialName("fullName") val fullName: String? = null, ) @Serializable data class Sub( - @SerialName("hi") val hi: Int? = null, - @SerialName("fullLink") val fullLink: String? = null, - @SerialName("linkName") val linkName: String? = null, - @SerialName("lang") val lang: String? = null, - @SerialName("releaseName") val releaseName: String? = null, - @SerialName("subId") val subId: Long? = null, + @JsonProperty("hi") @SerialName("hi") val hi: Int? = null, + @JsonProperty("fullLink") @SerialName("fullLink") val fullLink: String? = null, + @JsonProperty("linkName") @SerialName("linkName") val linkName: String? = null, + @JsonProperty("lang") @SerialName("lang") val lang: String? = null, + @JsonProperty("releaseName") @SerialName("releaseName") val releaseName: String? = null, + @JsonProperty("subId") @SerialName("subId") val subId: Long? = null, ) @Serializable data class SubData( - @SerialName("movie") val movie: String, - @SerialName("lang") val lang: String, - @SerialName("id") val id: String, + @JsonProperty("movie") @SerialName("movie") val movie: String, + @JsonProperty("lang") @SerialName("lang") val lang: String, + @JsonProperty("id") @SerialName("id") val id: String, ) @Serializable data class SubTitleLink( - @SerialName("sub") val sub: SubToken, + @JsonProperty("sub") @SerialName("sub") val sub: SubToken, ) @Serializable data class SubToken( - @SerialName("downloadToken") val downloadToken: String, + @JsonProperty("downloadToken") @SerialName("downloadToken") val downloadToken: String, ) }