mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 11:17:25 +01:00
Label one-shots correctly in anilist track search (#5741)
* use format instead of type in anilist search As per anilist graphql docs, `type` refers to whether anime/manga and is redundant (since we already limit it to `MANGA`). What we actually want is `format` which includes whether the media is a One-shot or Manga This should help in making search a bit better as one no longer needs to rely on the Date to figure out if its the One-shot entry or the Manga entry * Revert "use format instead of type in anilist search" This reverts commit 6f0ba4888669f414a2093d7632eb1fab109d74de. Accidentally changed the wrong query while further testing whoops * use format instead of type in anilist search As per anilist graphql docs, `type` refers to whether anime/manga and is redundant (since we already limit it to `MANGA`). What we actually want is `format` which includes whether the media is a One-shot or Manga Changes search query and corresponding JSONALManga structure
This commit is contained in:
parent
24b967ad5c
commit
27133520fc
@ -115,7 +115,7 @@ class AnilistApi(val client: OkHttpClient, interceptor: AnilistInterceptor) {
|
|||||||
|coverImage {
|
|coverImage {
|
||||||
|large
|
|large
|
||||||
|}
|
|}
|
||||||
|type
|
|format
|
||||||
|status
|
|status
|
||||||
|chapters
|
|chapters
|
||||||
|description
|
|description
|
||||||
@ -267,7 +267,7 @@ class AnilistApi(val client: OkHttpClient, interceptor: AnilistInterceptor) {
|
|||||||
struct["title"]!!.jsonObject["romaji"]!!.jsonPrimitive.content,
|
struct["title"]!!.jsonObject["romaji"]!!.jsonPrimitive.content,
|
||||||
struct["coverImage"]!!.jsonObject["large"]!!.jsonPrimitive.content,
|
struct["coverImage"]!!.jsonObject["large"]!!.jsonPrimitive.content,
|
||||||
struct["description"]!!.jsonPrimitive.contentOrNull,
|
struct["description"]!!.jsonPrimitive.contentOrNull,
|
||||||
struct["type"]!!.jsonPrimitive.content,
|
struct["format"]!!.jsonPrimitive.content.replace("_", "-"),
|
||||||
struct["status"]!!.jsonPrimitive.contentOrNull ?: "",
|
struct["status"]!!.jsonPrimitive.contentOrNull ?: "",
|
||||||
parseDate(struct, "startDate"),
|
parseDate(struct, "startDate"),
|
||||||
struct["chapters"]!!.jsonPrimitive.intOrNull ?: 0
|
struct["chapters"]!!.jsonPrimitive.intOrNull ?: 0
|
||||||
|
@ -13,7 +13,7 @@ data class ALManga(
|
|||||||
val title_romaji: String,
|
val title_romaji: String,
|
||||||
val image_url_lge: String,
|
val image_url_lge: String,
|
||||||
val description: String?,
|
val description: String?,
|
||||||
val type: String,
|
val format: String,
|
||||||
val publishing_status: String,
|
val publishing_status: String,
|
||||||
val start_date_fuzzy: Long,
|
val start_date_fuzzy: Long,
|
||||||
val total_chapters: Int
|
val total_chapters: Int
|
||||||
@ -27,7 +27,7 @@ data class ALManga(
|
|||||||
summary = description ?: ""
|
summary = description ?: ""
|
||||||
tracking_url = AnilistApi.mangaUrl(media_id)
|
tracking_url = AnilistApi.mangaUrl(media_id)
|
||||||
publishing_status = this@ALManga.publishing_status
|
publishing_status = this@ALManga.publishing_status
|
||||||
publishing_type = type
|
publishing_type = format
|
||||||
if (start_date_fuzzy != 0L) {
|
if (start_date_fuzzy != 0L) {
|
||||||
start_date = try {
|
start_date = try {
|
||||||
val outputDf = SimpleDateFormat("yyyy-MM-dd", Locale.US)
|
val outputDf = SimpleDateFormat("yyyy-MM-dd", Locale.US)
|
||||||
|
Loading…
Reference in New Issue
Block a user