Skip to content

Commit

Permalink
add ignorenulls to json decoder (fixes hitomi)
Browse files Browse the repository at this point in the history
  • Loading branch information
az4521 committed Mar 14, 2024
1 parent ca995ff commit 6c78fec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ dependencies {
implementation "com.squareup.retrofit2:adapter-rxjava:$retrofit_version"

// JSON
final kotlin_serialization_version = '1.6.2'
final kotlin_serialization_version = '1.6.3'
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlin_serialization_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json-okio:$kotlin_serialization_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-protobuf:$kotlin_serialization_version"
Expand Down Expand Up @@ -418,9 +418,9 @@ tasks.withType(AbstractKotlinCompile).all {
//kotlinOptions.freeCompilerArgs += ["-Xopt-in=kotlin.RequiresOptIn"]
//kotlinOptions.freeCompilerArgs += ["-Xuse-experimental=kotlin.ExperimentalStdlibApi"]
//kotlinOptions.freeCompilerArgs += ["-Xuse-experimental=kotlinx.coroutines.FlowPreview"]
//kotlinOptions.freeCompilerArgs += ["-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi"]
kotlinOptions.freeCompilerArgs += ["-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"]
//kotlinOptions.freeCompilerArgs += ["-Xuse-experimental=kotlinx.coroutines.InternalCoroutinesApi"]
//kotlinOptions.freeCompilerArgs += ["-Xuse-experimental=kotlinx.serialization.ExperimentalSerializationApi"]
kotlinOptions.freeCompilerArgs += ["-opt-in=kotlinx.serialization.ExperimentalSerializationApi"]
//kotlinOptions.freeCompilerArgs += ["-Xuse-experimental=coil.annotation.ExperimentalCoilApi"]
}

Expand Down
9 changes: 6 additions & 3 deletions app/src/main/java/eu/kanade/tachiyomi/AppModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ class AppModule(val app: Application) : InjektModule {
override fun InjektRegistrar.registerInjectables() {
addSingleton(app)

addSingletonFactory { Json { ignoreUnknownKeys = true } }
addSingletonFactory {
Json {
ignoreUnknownKeys = true
explicitNulls = false
}
}

addSingletonFactory { PreferencesHelper(app) }

Expand Down Expand Up @@ -57,8 +62,6 @@ class AppModule(val app: Application) : InjektModule {

addSingletonFactory { Markwon.create(app) }

addSingletonFactory { Json { ignoreUnknownKeys = true } }

addSingletonFactory { DelayedTrackingStore(app) }

// Asynchronously init expensive components for a faster cold start
Expand Down

0 comments on commit 6c78fec

Please sign in to comment.