Skip to content

Commit 59d903e

Browse files
Updated dependencies and fixed property 'useLocalFiles'
1 parent 994e106 commit 59d903e

File tree

5 files changed

+27
-22
lines changed

5 files changed

+27
-22
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
.kotlin
2+
3+
14
# Created by https://www.toptal.com/developers/gitignore/api/linux,macos,gradle,kotlin,windows,intellij,intellij+all,intellij+iml,visualstudiocode
25
# Edit at https://www.toptal.com/developers/gitignore?templates=linux,macos,gradle,kotlin,windows,intellij,intellij+all,intellij+iml,visualstudiocode
36

gradle/libs.versions.toml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
[versions]
22
kotlin = "2.2.0"
33
kotlinx-coroutines-core-jvm = "1.10.2"
4-
modb-core = "19.0.3"
5-
modb-serde = "6.0.4"
6-
modb-anidb = "7.0.6"
7-
modb-anilist = "7.2.7"
8-
modb-animeplanet = "6.3.7"
9-
modb-animenewsnetwork = "1.1.8"
10-
modb-anisearch = "4.2.8"
11-
modb-kitsu = "7.1.9"
12-
modb-livechart = "4.2.7"
13-
modb-myanimelist = "7.2.7"
14-
modb-notify = "6.2.7"
15-
modb-simkl = "1.2.7"
16-
modb-test = "1.8.1"
4+
modb-core = "19.0.4"
5+
modb-serde = "6.1.0"
6+
modb-anidb = "7.0.7"
7+
modb-anilist = "7.2.8"
8+
modb-animeplanet = "6.3.8"
9+
modb-animenewsnetwork = "1.1.9"
10+
modb-anisearch = "4.2.9"
11+
modb-kitsu = "7.1.10"
12+
modb-livechart = "4.2.8"
13+
modb-myanimelist = "7.2.8"
14+
modb-notify = "6.2.8"
15+
modb-simkl = "1.2.8"
16+
modb-test = "1.8.2"
1717
commons-text = "1.14.0"
1818
commons-lang3 = "3.18.0"
1919
logback-classic = "1.5.18"

manami-app/src/main/kotlin/io/github/manamiproject/manami/app/cache/populator/AnimeCachePopulator.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ internal class AnimeCachePopulator(
4242
configRegistry: ConfigRegistry = DefaultConfigRegistry.instance,
4343
) : CachePopulator<URI, CacheEntry<Anime>> {
4444

45-
private val isUseLocalFiles by BooleanPropertyDelegate(
46-
namespace = "manami.cache.useLocalFiles",
45+
private val useLocalFiles by BooleanPropertyDelegate(
46+
namespace = "manami.cache",
4747
configRegistry = configRegistry,
4848
default = true
4949
)
5050

5151
override suspend fun populate(cache: Cache<URI, CacheEntry<Anime>>) {
52-
val animeFlow = if (isUseLocalFiles) {
52+
val animeFlow = if (useLocalFiles) {
5353
val file = Path(fileName)
5454

5555
val isDownloadFile = if (!file.regularFileExists()) {
@@ -71,11 +71,11 @@ internal class AnimeCachePopulator(
7171
httpClient.get(uri.toURL()).bodyAsByteArray().writeToFile(file)
7272
}
7373

74-
log.info {"Populating cache with anime." }
74+
log.info { "Populating cache with anime." }
7575

7676
fileDeserializer.deserialize(file)
7777
} else {
78-
log.info {"Populating cache with anime from [$uri]." }
78+
log.info { "Populating cache with anime from [$uri]." }
7979
urlDeserializer.deserialize(uri.toURL())
8080
}
8181

manami-app/src/main/kotlin/io/github/manamiproject/manami/app/cache/populator/DeadEntriesCachePopulator.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ internal class DeadEntriesCachePopulator(
3939
configRegistry: ConfigRegistry = DefaultConfigRegistry.instance,
4040
) : CachePopulator<URI, CacheEntry<Anime>> {
4141

42-
private val isUseLocalFiles by BooleanPropertyDelegate(
43-
namespace = "manami.cache.useLocalFiles",
42+
private val useLocalFiles by BooleanPropertyDelegate(
43+
namespace = "manami.cache",
4444
configRegistry = configRegistry,
4545
default = true,
4646
)
4747

4848
override suspend fun populate(cache: Cache<URI, CacheEntry<Anime>>) {
4949
log.info { "Populating cache with dead entries from [${config.hostname()}]" }
5050

51-
val deadEntries = if (isUseLocalFiles) {
51+
val deadEntries = if (useLocalFiles) {
5252
val file = Path("${config.hostname()}.zst")
5353

5454
val isDownloadFile = if (!file.regularFileExists()) {
@@ -66,7 +66,7 @@ internal class DeadEntriesCachePopulator(
6666
}
6767

6868
if (isDownloadFile) {
69-
log.info {"Downloading dead entries file from [$url], because a local file doesn't exist." }
69+
log.info { "Downloading dead entries file from [$url], because a local file doesn't exist." }
7070
httpClient.get(url).bodyAsByteArray().writeToFile(file)
7171
}
7272

manami-app/src/test/kotlin/io/github/manamiproject/manami/app/cache/TestingAssets.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import io.github.manamiproject.modb.core.httpclient.RequestBody
1010
import io.github.manamiproject.modb.core.anime.Anime
1111
import io.github.manamiproject.modb.core.anime.AnimeRaw
1212
import io.github.manamiproject.modb.core.anime.Tag
13+
import io.github.manamiproject.modb.core.httpclient.RetryCase
1314
import io.github.manamiproject.modb.test.shouldNotBeInvoked
1415
import java.net.URI
1516
import java.net.URL
@@ -41,6 +42,7 @@ internal object TestAnimeConverter: AnimeConverter {
4142

4243
internal object TestHttpClient: HttpClient {
4344
override suspend fun get(url: URL, headers: Map<String, Collection<String>>): HttpResponse = shouldNotBeInvoked()
45+
override fun addRetryCases(vararg retryCases: RetryCase): HttpClient = shouldNotBeInvoked()
4446
override suspend fun post(url: URL, requestBody: RequestBody, headers: Map<String, Collection<String>>): HttpResponse = shouldNotBeInvoked()
4547
}
4648

0 commit comments

Comments
 (0)