From 31bde4124db4e29999dd6ed98ae900d8535b2c12 Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Mon, 22 Mar 2021 16:36:18 -0400 Subject: [PATCH] tagging manga/manhwa/etc. for md v2's tags --- .../tachiyomi/data/database/models/Manga.kt | 16 +++++++--------- .../tachiyomi/source/online/all/MangaDex.kt | 3 ++- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/database/models/Manga.kt b/app/src/main/java/eu/kanade/tachiyomi/data/database/models/Manga.kt index f68d78aaa6..e09ae08b39 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/database/models/Manga.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/database/models/Manga.kt @@ -76,15 +76,13 @@ interface Manga : SManga { val sourceName = Injekt.get().getOrStub(source).name val currentTags = genre?.split(",")?.map { it.trim().toLowerCase(Locale.US) } ?: emptyList() - return if (currentTags.any { tag -> tag.startsWith("japanese") || isMangaTag(tag) }) { + return if (currentTags.any { tag -> isMangaTag(tag) }) { TYPE_MANGA - } else if (currentTags.any { tag -> tag.startsWith("english") || isComicTag(tag) } || + } else if (currentTags.any { tag -> isComicTag(tag) } || isComicSource(sourceName) ) { TYPE_COMIC - } else if (currentTags.any { tag -> - tag.startsWith("chinese") || isManhuaTag(tag) - } || sourceName.contains("manhua", true) + } else if (currentTags.any { tag -> isManhuaTag(tag) } || sourceName.contains("manhua", true) ) { TYPE_MANHUA } else if (currentTags.any { tag -> isManhwaTag(tag) } || isWebtoonSource(sourceName)) { @@ -121,19 +119,19 @@ interface Manga : SManga { } fun isMangaTag(tag: String): Boolean { - return tag in listOf("manga", "манга") + return tag in listOf("manga", "манга", "jp") || tag.startsWith("japanese") } fun isManhuaTag(tag: String): Boolean { - return tag in listOf("manhua", "маньхуа") + return tag in listOf("manhua", "маньхуа", "cn", "hk", "zh-Hans", "zh-Hant") || tag.startsWith("chinese") } fun isManhwaTag(tag: String): Boolean { - return tag in listOf("long strip", "manhwa", "манхва") + return tag in listOf("long strip", "manhwa", "манхва", "kr") || tag.startsWith("korean") } fun isComicTag(tag: String): Boolean { - return tag in listOf("comic", "комикс") + return tag in listOf("comic", "комикс", "en", "gb") || tag.startsWith("english") } fun isWebtoonSource(sourceName: String): Boolean { diff --git a/app/src/main/java/eu/kanade/tachiyomi/source/online/all/MangaDex.kt b/app/src/main/java/eu/kanade/tachiyomi/source/online/all/MangaDex.kt index c28a26e3e9..8d16b462c9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/source/online/all/MangaDex.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/online/all/MangaDex.kt @@ -99,7 +99,8 @@ class MangaDex : DelegatedHttpSource() { "ir" -> "fa" "rs" -> "sh" "ua" -> "uk" - "cn" -> "zh-Hans" "hk" -> "zh-Hant" + "cn" -> "zh-Hans" + "hk" -> "zh-Hant" else -> langCode } }