This commit is contained in:
Jobobby04 2020-08-06 14:57:54 -04:00
parent 165b243aab
commit 2de87f8d29
2 changed files with 4 additions and 5 deletions

View File

@ -265,12 +265,12 @@ class MangaPresenter(
manga.author = author?.trimOrNull() manga.author = author?.trimOrNull()
manga.artist = artist?.trimOrNull() manga.artist = artist?.trimOrNull()
manga.description = description?.trimOrNull() manga.description = description?.trimOrNull()
val tagsString = tags?.joinToString(", ") val tagsString = tags?.joinToString()
manga.genre = if (tags.isNullOrEmpty()) null else tagsString?.trim() manga.genre = if (tags.isNullOrEmpty()) null else tagsString?.trim()
LocalSource(downloadManager.context).updateMangaInfo(manga) LocalSource(downloadManager.context).updateMangaInfo(manga)
db.updateMangaInfo(manga).executeAsBlocking() db.updateMangaInfo(manga).executeAsBlocking()
} else { } else {
val genre = if (!tags.isNullOrEmpty() && tags.joinToString(", ") != manga.genre) { val genre = if (!tags.isNullOrEmpty() && tags.joinToString() != manga.genre) {
tags.toTypedArray() tags.toTypedArray()
} else { } else {
null null

View File

@ -5,12 +5,11 @@ import eu.kanade.tachiyomi.source.SourceManager
import exh.EH_SOURCE_ID import exh.EH_SOURCE_ID
import exh.EXH_SOURCE_ID import exh.EXH_SOURCE_ID
import exh.NHENTAI_SOURCE_ID import exh.NHENTAI_SOURCE_ID
import java.util.Locale
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
fun Manga.isLewd(): Boolean { fun Manga.isLewd(): Boolean {
val sourceName = Injekt.get<SourceManager>().getOrStub(source).name val sourceName = Injekt.get<SourceManager>().get(source)?.name
val currentTags = getGenres() ?: emptyList() val currentTags = getGenres() ?: emptyList()
if (source == EH_SOURCE_ID || source == EXH_SOURCE_ID || source == NHENTAI_SOURCE_ID) { if (source == EH_SOURCE_ID || source == EXH_SOURCE_ID || source == NHENTAI_SOURCE_ID) {
@ -19,7 +18,7 @@ fun Manga.isLewd(): Boolean {
return source in 6905L..6913L || return source in 6905L..6913L ||
// source in lewdDelegatedSourceIds || // source in lewdDelegatedSourceIds ||
isHentaiSource(sourceName) || (sourceName != null && isHentaiSource(sourceName)) ||
currentTags.any { tag -> isHentaiTag(tag) } currentTags.any { tag -> isHentaiTag(tag) }
} }