Heavenmanga date parse fix (#1467)

Heavenmanga date parse fix
This commit is contained in:
Mike 2019-09-05 21:11:50 -04:00 committed by Eugene
parent bf85da6746
commit e8426d112c
2 changed files with 5 additions and 18 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Heaven Manga' appName = 'Tachiyomi: Heaven Manga'
pkgNameSuffix = 'en.heavenmanga' pkgNameSuffix = 'en.heavenmanga'
extClass = '.Heavenmanga' extClass = '.Heavenmanga'
extVersionCode = 2 extVersionCode = 3
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -17,7 +17,7 @@ class Heavenmanga : ParsedHttpSource() {
override val name = "Heaven Manga" override val name = "Heaven Manga"
override val baseUrl = "http://heavenmanga.vip" override val baseUrl = "http://ww2.heavenmanga.org"
override val lang = "en" override val lang = "en"
@ -40,14 +40,9 @@ class Heavenmanga : ParsedHttpSource() {
override fun searchMangaNextPageSelector() = popularMangaNextPageSelector() override fun searchMangaNextPageSelector() = popularMangaNextPageSelector()
// popular // popular
override fun popularMangaRequest(page: Int): Request { override fun popularMangaRequest(page: Int): Request {
if (page == 1) { return GET("$baseUrl/manga-list/page-$page", headers)
return GET("$baseUrl/manga-list/")
} else {
return GET("$baseUrl/manga-list/page-$page")
}
} }
override fun popularMangaFromElement(element: Element): SManga { override fun popularMangaFromElement(element: Element): SManga {
@ -60,21 +55,13 @@ class Heavenmanga : ParsedHttpSource() {
return manga return manga
} }
// latest // latest
override fun latestUpdatesRequest(page: Int): Request { override fun latestUpdatesRequest(page: Int): Request {
if (page == 1) { return GET("$baseUrl/latest-update/page-$page", headers)
return GET("$baseUrl/latest-update/")
} else {
return GET("$baseUrl/latest-update/page-$page")
}
} }
override fun latestUpdatesFromElement(element: Element) = popularMangaFromElement(element) override fun latestUpdatesFromElement(element: Element) = popularMangaFromElement(element)
// search // search
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val url = if (query.isNotBlank()) { val url = if (query.isNotBlank()) {
@ -166,7 +153,7 @@ class Heavenmanga : ParsedHttpSource() {
document.select(chapterListSelector()).map{allChapters.add(chapterFromElement(it))} document.select(chapterListSelector()).map{allChapters.add(chapterFromElement(it))}
// Chapter dates // Chapter dates
document.select("div.chapter-date").forEach { document.select("div.chapter-date").forEach {
allChapters[dateIndex].date_upload = parseDate(it.text()) if (it.hasText()) allChapters[dateIndex].date_upload = parseDate(it.text())
dateIndex++ dateIndex++
} }
// Next page of chapters // Next page of chapters