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:
@@ -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