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:
MajorTanya
2026-08-17 12:28:25 +02:00
committed by GitHub
parent 8586d81e63
commit c613b52503
3 changed files with 14 additions and 0 deletions
@@ -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 }
}
}