Skip to content

Commit

Permalink
Merge pull request #286 from Shikkanime/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Ziedelth authored Mar 14, 2024
2 parents 30a0152 + 78a8a1c commit cbce6f0
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ val guiceVersion = "7.0.0"
val liquibaseCoreVersion = "4.26.0"
val quartzVersion = "2.5.0-rc1"
val guavaVersion = "33.0.0-jre"
val jacksonVersion = "2.16.2"
val jacksonVersion = "2.17.0"
val playwrightVersion = "1.42.0"
val jsoupVersion = "1.17.2"
val gsonVersion = "2.10.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ enum class ConfigPropertyKey(val key: String) {
ANALYTICS_DOMAIN("analytics_domain"),
ANALYTICS_API("analytics_api"),
ANALYTICS_SCRIPT("analytics_script"),
CRUNCHYROLL_FETCH_API_SIZE("crunchyroll_fetch_api_size"),
}
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,11 @@ class CrunchyrollPlatform : AbstractPlatform<CrunchyrollConfiguration, CountryCo

override suspend fun fetchApiContent(key: CountryCode, zonedDateTime: ZonedDateTime): List<JsonObject> {
return if (configCacheService.getValueAsBoolean(ConfigPropertyKey.USE_CRUNCHYROLL_API)) {
CrunchyrollWrapper.getBrowse(key.locale, identifiers[key]!!.first)
CrunchyrollWrapper.getBrowse(
key.locale,
identifiers[key]!!.first,
size = configCacheService.getValueAsInt(ConfigPropertyKey.CRUNCHYROLL_FETCH_API_SIZE, 25)
)
} else {
val url = "https://www.crunchyroll.com/rss/anime?lang=${key.locale.replace("-", "")}"
val response = HttpRequest().get(url)
Expand Down
24 changes: 24 additions & 0 deletions src/main/resources/db/changelog/2024/03/05-changelog.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd"
objectQuotingStrategy="QUOTE_ONLY_RESERVED_WORDS">
<property global="false" name="id" value="1710408011612"/>
<property global="false" name="author" value="Ziedelth"/>

<changeSet id="${id}-1" author="${author}" dbms="postgresql">
<preConditions onFail="MARK_RAN">
<sqlCheck expectedResult="0">SELECT COUNT(*)
FROM config
WHERE property_key = 'crunchyroll_fetch_api_size'</sqlCheck>
</preConditions>

<insert tableName="config">
<column name="uuid" valueComputed="gen_random_uuid()"/>
<column name="property_key" value="crunchyroll_fetch_api_size"/>
<column name="property_value" value="25"/>
</insert>
</changeSet>
</databaseChangeLog>
1 change: 1 addition & 0 deletions src/main/resources/db/changelog/db.changelog-master.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@
<include file="/db/changelog/2024/03/02-changelog.xml"/>
<include file="/db/changelog/2024/03/03-changelog.xml"/>
<include file="/db/changelog/2024/03/04-changelog.xml"/>
<include file="/db/changelog/2024/03/05-changelog.xml"/>
</databaseChangeLog>

0 comments on commit cbce6f0

Please sign in to comment.