Bump dependencies

This commit is contained in:
arkon 2023-05-31 22:48:13 -04:00
parent 431f8772f8
commit 1a1f16f44a
6 changed files with 17 additions and 10 deletions

View file

@ -218,6 +218,7 @@ dependencies {
implementation(libs.injekt.core) implementation(libs.injekt.core)
// Image loading // Image loading
implementation(platform(libs.coil.bom))
implementation(libs.bundles.coil) implementation(libs.bundles.coil)
implementation(libs.subsamplingscaleimageview) { implementation(libs.subsamplingscaleimageview) {
exclude(module = "image-decoder") exclude(module = "image-decoder")

View file

@ -222,18 +222,22 @@ class MangaCoverFetcher(
} }
private fun readFromDiskCache(): DiskCache.Snapshot? { private fun readFromDiskCache(): DiskCache.Snapshot? {
return if (options.diskCachePolicy.readEnabled) diskCacheLazy.value[diskCacheKey] else null return if (options.diskCachePolicy.readEnabled) {
diskCacheLazy.value.openSnapshot(diskCacheKey)
} else {
null
}
} }
private fun writeToDiskCache( private fun writeToDiskCache(
response: Response, response: Response,
): DiskCache.Snapshot? { ): DiskCache.Snapshot? {
val editor = diskCacheLazy.value.edit(diskCacheKey) ?: return null val editor = diskCacheLazy.value.openEditor(diskCacheKey) ?: return null
try { try {
diskCacheLazy.value.fileSystem.write(editor.data) { diskCacheLazy.value.fileSystem.write(editor.data) {
response.body.source().readAll(this) response.body.source().readAll(this)
} }
return editor.commitAndGet() return editor.commitAndOpenSnapshot()
} catch (e: Exception) { } catch (e: Exception) {
try { try {
editor.abort() editor.abort()

View file

@ -1,5 +1,5 @@
[versions] [versions]
agp_version = "8.0.1" agp_version = "8.0.2"
lifecycle_version = "2.6.1" lifecycle_version = "2.6.1"
[libraries] [libraries]

View file

@ -1,6 +1,6 @@
[versions] [versions]
kotlin_version = "1.8.21" kotlin_version = "1.8.21"
serialization_version = "1.5.0" serialization_version = "1.5.1"
xml_serialization_version = "0.86.0" xml_serialization_version = "0.86.0"
[libraries] [libraries]

View file

@ -1,7 +1,6 @@
[versions] [versions]
aboutlib_version = "10.6.2" aboutlib_version = "10.7.0"
okhttp_version = "5.0.0-alpha.11" okhttp_version = "5.0.0-alpha.11"
coil_version = "2.3.0"
shizuku_version = "12.2.0" shizuku_version = "12.2.0"
sqlite = "2.3.1" sqlite = "2.3.1"
sqldelight = "1.5.5" sqldelight = "1.5.5"
@ -41,9 +40,10 @@ preferencektx = "androidx.preference:preference-ktx:1.2.0"
injekt-core = "com.github.inorichi.injekt:injekt-core:65b0440" injekt-core = "com.github.inorichi.injekt:injekt-core:65b0440"
coil-core = { module = "io.coil-kt:coil", version.ref = "coil_version" } coil-bom = { module = "io.coil-kt:coil-bom", version = "2.4.0" }
coil-gif = { module = "io.coil-kt:coil-gif", version.ref = "coil_version" } coil-core = { module = "io.coil-kt:coil" }
coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil_version" } coil-gif = { module = "io.coil-kt:coil-gif" }
coil-compose = { module = "io.coil-kt:coil-compose" }
subsamplingscaleimageview = "com.github.tachiyomiorg:subsampling-scale-image-view:c8e2650" subsamplingscaleimageview = "com.github.tachiyomiorg:subsampling-scale-image-view:c8e2650"
image-decoder = "com.github.tachiyomiorg:image-decoder:7879b45" image-decoder = "com.github.tachiyomiorg:image-decoder:7879b45"

View file

@ -27,6 +27,8 @@ dependencies {
implementation(androidx.glance) implementation(androidx.glance)
implementation(platform(libs.coil.bom))
implementation(libs.coil.core) implementation(libs.coil.core)
api(libs.injekt.core) api(libs.injekt.core)
} }