diff --git a/CHANGELOG.md b/CHANGELOG.md index bd7d289125..7e960fc027 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co ### Fixed - Fixed "currentTab was used multiple times" +### Improved +- Bangumi search now shows the score and summary of a search result ([@MajorTanya](https://github.com/MajorTanya)) ([#1396](https://github.com/mihonapp/mihon/pull/1396)) + ## [v0.17.0] - 2024-10-26 ### Added - Option to disable reader zoom out ([@Splintorien](https://github.com/Splintorien)) ([#302](https://github.com/mihonapp/mihon/pull/302)) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiApi.kt index 859f10d3e6..bba70d44af 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiApi.kt @@ -71,6 +71,8 @@ class BangumiApi( val url = "$API_URL/search/subject/${URLEncoder.encode(search, StandardCharsets.UTF_8.name())}" .toUri() .buildUpon() + .appendQueryParameter("type", "1") + .appendQueryParameter("responseGroup", "large") .appendQueryParameter("max_results", "20") .build() with(json) { @@ -81,7 +83,6 @@ class BangumiApi( if (result.code == 404) emptyList() result.list - ?.filter { it.type == 1 } ?.map { it.toTrackSearch(trackId) } .orEmpty() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/dto/BGMSearch.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/dto/BGMSearch.kt index 241b954306..9c3151f494 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/dto/BGMSearch.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/dto/BGMSearch.kt @@ -17,6 +17,7 @@ data class BGMSearchItem( val nameCn: String, val name: String, val type: Int, + val summary: String?, val images: BGMSearchItemCovers?, @SerialName("eps_count") val epsCount: Long?, @@ -25,9 +26,13 @@ data class BGMSearchItem( ) { fun toTrackSearch(trackId: Long): TrackSearch = TrackSearch.create(trackId).apply { remote_id = this@BGMSearchItem.id - title = nameCn - cover_url = images?.common ?: "" - summary = this@BGMSearchItem.name + title = nameCn.ifBlank { name } + cover_url = images?.common.orEmpty() + summary = if (nameCn.isNotBlank()) { + "作品原名:$name" + this@BGMSearchItem.summary?.let { "\n$it" }.orEmpty() + } else { + this@BGMSearchItem.summary.orEmpty() + } score = rating?.score ?: -1.0 tracking_url = url total_chapters = epsCount ?: 0