diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsGeneral.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsGeneral.kt index 57f5aa87098..4621a7b1f58 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsGeneral.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsGeneral.kt @@ -48,6 +48,8 @@ import com.lagradost.cloudstream3.utils.USER_PROVIDER_API import com.lagradost.cloudstream3.utils.downloader.DownloadFileManagement import com.lagradost.cloudstream3.utils.downloader.DownloadFileManagement.getBasePath import com.lagradost.cloudstream3.utils.downloader.DownloadQueueManager +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable import java.util.Locale // Change local language settings in the app. @@ -134,7 +136,7 @@ fun Pair.nameNextToFlagEmoji(): String { // fallback to [A][A] -> [?] question mak flag val flag = SubtitleHelper.getFlagFromIso(this.second) ?: "\ud83c\udde6\ud83c\udde6" - return "$flag\u00a0${this.first}" // \u00a0 non-breaking space + return "$flag\u00a0${this.first}" // \u00a0 non-breaking space } class SettingsGeneral : BasePreferenceFragmentCompat() { @@ -145,15 +147,12 @@ class SettingsGeneral : BasePreferenceFragmentCompat() { setToolBarScrollFlags() } + @Serializable data class CustomSite( - @JsonProperty("parentJavaClass") // javaClass.simpleName - val parentJavaClass: String, - @JsonProperty("name") - val name: String, - @JsonProperty("url") - val url: String, - @JsonProperty("lang") - val lang: String, + @JsonProperty("parentJavaClass") @SerialName("parentJavaClass") val parentJavaClass: String, // javaClass.simpleName + @JsonProperty("name") @SerialName("name") val name: String, + @JsonProperty("url") @SerialName("url") val url: String, + @JsonProperty("lang") @SerialName("lang") val lang: String, ) companion object { diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/extensions/ExtensionsViewModel.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/extensions/ExtensionsViewModel.kt index 482251b7831..af76b85efc9 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/extensions/ExtensionsViewModel.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/extensions/ExtensionsViewModel.kt @@ -15,13 +15,16 @@ import com.lagradost.cloudstream3.plugins.RepositoryManager.PREBUILT_REPOSITORIE import com.lagradost.cloudstream3.utils.UiText import com.lagradost.cloudstream3.utils.txt import com.lagradost.cloudstream3.utils.Coroutines.ioSafe +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +@Serializable data class RepositoryData( - @JsonProperty("iconUrl") val iconUrl: String?, - @JsonProperty("name") val name: String, - @JsonProperty("url") val url: String -){ - constructor(name: String,url: String):this(null,name,url) + @JsonProperty("iconUrl") @SerialName("iconUrl") val iconUrl: String?, + @JsonProperty("name") @SerialName("name") val name: String, + @JsonProperty("url") @SerialName("url") val url: String, +) { + constructor(name: String, url: String): this(null, name, url) } const val REPOSITORIES_KEY = "REPOSITORIES_KEY" @@ -90,4 +93,4 @@ class ExtensionsViewModel : ViewModel() { val urls = repos() _repositories.postValue(urls) } -} \ No newline at end of file +}