MangaSee, MangaLife - more accurate date parsing (#3783)

This commit is contained in:
Mike 2020-07-13 21:10:57 -04:00 committed by GitHub
parent 8ef7624233
commit ff77a2495c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'MangaLife'
pkgNameSuffix = 'en.mangalife'
extClass = '.MangaLife'
extVersionCode = 7
extVersionCode = 8
libVersion = '1.2'
}

View File

@ -205,7 +205,7 @@ class MangaLife : HttpSource() {
// Chapters - Mind special cases like decimal chapters (e.g. One Punch Man) and manga with seasons (e.g. The Gamer)
private val dateFormat = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault())
private val dateFormat = SimpleDateFormat("yyyy-MM-dd HH:mm:SS Z", Locale.getDefault())
private fun chapterURLEncode(e: String): String {
var index = ""
@ -238,7 +238,7 @@ class MangaLife : HttpSource() {
name = json["ChapterName"].nullString.let { if (it.isNullOrEmpty()) "${json["Type"].string} ${chapterImage(indexChapter)}" else it }
url = "/read-online/" + response.request().url().toString().substringAfter("/manga/") + chapterURLEncode(indexChapter)
date_upload = try {
dateFormat.parse(json["Date"].string.substringBefore(" "))?.time ?: 0
json["Date"].nullString?.let { dateFormat.parse("$it +0600")?.time } ?: 0
} catch (_: Exception) {
0L
}

View File

@ -5,7 +5,7 @@ ext {
extName = 'Mangasee'
pkgNameSuffix = 'en.mangasee'
extClass = '.Mangasee'
extVersionCode = 10
extVersionCode = 11
libVersion = '1.2'
}

View File

@ -208,7 +208,7 @@ class Mangasee : HttpSource() {
// Chapters - Mind special cases like decimal chapters (e.g. One Punch Man) and manga with seasons (e.g. The Gamer)
private val dateFormat = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault())
private val dateFormat = SimpleDateFormat("yyyy-MM-dd HH:mm:SS Z", Locale.getDefault())
private fun chapterURLEncode(e: String): String {
var index = ""
@ -243,7 +243,7 @@ class Mangasee : HttpSource() {
name = json["ChapterName"].nullString.let { if (it.isNullOrEmpty()) "${json["Type"].string} ${chapterImage(indexChapter, true)}" else it }
url = "/read-online/" + response.request().url().toString().substringAfter("/manga/") + chapterURLEncode(indexChapter)
date_upload = try {
dateFormat.parse(json["Date"].string.substringBefore(" "))?.time ?: 0
json["Date"].nullString?.let { dateFormat.parse("$it +0600")?.time } ?: 0
} catch (_: Exception) {
0L
}