Readmanga and Mintmanga: Status fix (#2703)
This commit is contained in:
parent
d4579b7e77
commit
8f5ddea8a1
|
@ -5,7 +5,7 @@ ext {
|
|||
appName = 'Tachiyomi: Mintmanga'
|
||||
pkgNameSuffix = 'ru.mintmanga'
|
||||
extClass = '.Mintmanga'
|
||||
extVersionCode = 20
|
||||
extVersionCode = 21
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -96,26 +96,16 @@ class Mintmanga : ParsedHttpSource() {
|
|||
manga.artist = infoElement.select("span.elem_illustrator").first()?.text()
|
||||
manga.genre = infoElement.select("span.elem_genre").text().replace(" ,", ",")
|
||||
manga.description = infoElement.select("div.manga-description").text()
|
||||
manga.status = parseStatus(infoElement)
|
||||
manga.status = parseStatus(infoElement.html())
|
||||
manga.thumbnail_url = infoElement.select("img").attr("data-full")
|
||||
return manga
|
||||
}
|
||||
|
||||
private fun parseStatus(element: Element): Int {
|
||||
val hiddenWarningMessage = element.select("span.hide > h3").first()
|
||||
val html = element.html()
|
||||
return if (hiddenWarningMessage != null) {
|
||||
when {
|
||||
html.contains("<b>Перевод:</b> продолжается") -> SManga.ONGOING
|
||||
html.contains("<h1 class=\"names\"> Сингл") || html.contains("<b>Перевод:</b> завершен") -> SManga.COMPLETED
|
||||
else -> SManga.UNKNOWN
|
||||
}
|
||||
} else {
|
||||
when {
|
||||
html.contains("<h3>Запрещена публикация произведения по копирайту</h3>") -> SManga.LICENSED
|
||||
else -> SManga.UNKNOWN
|
||||
}
|
||||
}
|
||||
private fun parseStatus(element: String): Int = when {
|
||||
element.contains("Запрещена публикация произведения по копирайту") -> SManga.LICENSED
|
||||
element.contains("<h1 class=\"names\"> Сингл") || element.contains("<b>Перевод:</b> завершен") -> SManga.COMPLETED
|
||||
element.contains("<b>Перевод:</b> продолжается") -> SManga.ONGOING
|
||||
else -> SManga.UNKNOWN
|
||||
}
|
||||
|
||||
override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> {
|
||||
|
|
|
@ -5,7 +5,7 @@ ext {
|
|||
appName = 'Tachiyomi: Readmanga'
|
||||
pkgNameSuffix = 'ru.readmanga'
|
||||
extClass = '.Readmanga'
|
||||
extVersionCode = 17
|
||||
extVersionCode = 18
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -96,26 +96,16 @@ class Readmanga : ParsedHttpSource() {
|
|||
manga.artist = infoElement.select("span.elem_illustrator").first()?.text()
|
||||
manga.genre = infoElement.select("span.elem_genre").text().replace(" ,", ",")
|
||||
manga.description = infoElement.select("div.manga-description").text()
|
||||
manga.status = parseStatus(infoElement)
|
||||
manga.status = parseStatus(infoElement.html())
|
||||
manga.thumbnail_url = infoElement.select("img").attr("data-full")
|
||||
return manga
|
||||
}
|
||||
|
||||
private fun parseStatus(element: Element): Int {
|
||||
val hiddenWarningMessage = element.select("span.hide > h3").first()
|
||||
val html = element.html()
|
||||
return if (hiddenWarningMessage != null) {
|
||||
when {
|
||||
html.contains("<b>Перевод:</b> продолжается") -> SManga.ONGOING
|
||||
html.contains("<h1 class=\"names\"> Сингл") || html.contains("<b>Перевод:</b> завершен") -> SManga.COMPLETED
|
||||
else -> SManga.UNKNOWN
|
||||
}
|
||||
} else {
|
||||
when {
|
||||
html.contains("<h3>Запрещена публикация произведения по копирайту</h3>") -> SManga.LICENSED
|
||||
else -> SManga.UNKNOWN
|
||||
}
|
||||
}
|
||||
private fun parseStatus(element: String): Int = when {
|
||||
element.contains("Запрещена публикация произведения по копирайту") -> SManga.LICENSED
|
||||
element.contains("<h1 class=\"names\"> Сингл") || element.contains("<b>Перевод:</b> завершен") -> SManga.COMPLETED
|
||||
element.contains("<b>Перевод:</b> продолжается") -> SManga.ONGOING
|
||||
else -> SManga.UNKNOWN
|
||||
}
|
||||
|
||||
override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> {
|
||||
|
|
Loading…
Reference in New Issue