Add score info to MangaUpdates search results (#3795)
Also added author info for `id:` prefix search results since those hit the single-series endpoint instead of `/search`, which does not include author information (I wish it did). Maybe unintuitive but the info is nice to have when available.
This commit is contained in:
@@ -16,6 +16,7 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co
|
||||
|
||||
### Improved
|
||||
- Show updates and upcoming filter icon as active for categories ([@Secozzi](https://github.com/Secozzi)) ([#3772](https://github.com/mihonapp/mihon/pull/3772))
|
||||
- Show scores in MangaUpdates search results (and authors for `id:` prefix searches) ([@MajorTanya](https://github.com/MajorTanya)) ([#3795](https://github.com/mihonapp/mihon/pull/3795))
|
||||
|
||||
### Fixed
|
||||
- Fixed app and extension update check running again on configuration change ([@AntsyLich](https://github.com/AntsyLich)) ([#3708](https://github.com/mihonapp/mihon/pull/3708))
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package eu.kanade.tachiyomi.data.track.mangaupdates.dto
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class MUAuthor(
|
||||
val name: String,
|
||||
val type: String,
|
||||
)
|
||||
@@ -21,6 +21,7 @@ data class MURecord(
|
||||
val ratingVotes: Int? = null,
|
||||
@SerialName("latest_chapter")
|
||||
val latestChapter: Int? = null,
|
||||
val authors: List<MUAuthor> = emptyList(),
|
||||
)
|
||||
|
||||
fun MURecord.toTrackSearch(id: Long): TrackSearch {
|
||||
@@ -34,5 +35,8 @@ fun MURecord.toTrackSearch(id: Long): TrackSearch {
|
||||
publishing_status = ""
|
||||
publishing_type = this@toTrackSearch.type.toString()
|
||||
start_date = this@toTrackSearch.year.toString()
|
||||
score = this@toTrackSearch.bayesianRating?.takeIf { it > 0 } ?: -1.0
|
||||
authors = this@toTrackSearch.authors.filter { it.type == "Author" }.map { it.name }
|
||||
artists = this@toTrackSearch.authors.filter { it.type == "Artist" }.map { it.name }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user