fix parseChapterDate (#1096)
* fix parseChapterDate * Update build.gradle * Update Mangahere.kt Ah sorry my bad
This commit is contained in:
parent
2b3d92981a
commit
c0d9d393bf
|
@ -5,7 +5,7 @@ ext {
|
||||||
appName = 'Tachiyomi: Mangahere'
|
appName = 'Tachiyomi: Mangahere'
|
||||||
pkgNameSuffix = 'en.mangahere'
|
pkgNameSuffix = 'en.mangahere'
|
||||||
extClass = '.Mangahere'
|
extClass = '.Mangahere'
|
||||||
extVersionCode = 8
|
extVersionCode = 9
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -161,11 +161,28 @@ class Mangahere : ParsedHttpSource() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun parseChapterDate(date: String): Long {
|
private fun parseChapterDate(date: String): Long {
|
||||||
return try {
|
return if ("Today" in date || " ago" in date){
|
||||||
SimpleDateFormat("MMM dd,yyyy", Locale.ENGLISH).parse(date).time
|
Calendar.getInstance().apply {
|
||||||
} catch (e: ParseException) {
|
set(Calendar.HOUR_OF_DAY, 0)
|
||||||
0L
|
set(Calendar.MINUTE, 0)
|
||||||
}
|
set(Calendar.SECOND, 0)
|
||||||
|
set(Calendar.MILLISECOND, 0)
|
||||||
|
}.timeInMillis
|
||||||
|
} else if ("Yesterday" in date) {
|
||||||
|
Calendar.getInstance().apply {
|
||||||
|
add(Calendar.DATE, -1)
|
||||||
|
set(Calendar.HOUR_OF_DAY, 0)
|
||||||
|
set(Calendar.MINUTE, 0)
|
||||||
|
set(Calendar.SECOND, 0)
|
||||||
|
set(Calendar.MILLISECOND, 0)
|
||||||
|
}.timeInMillis
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
SimpleDateFormat("MMM dd,yyyy", Locale.ENGLISH).parse(date).time
|
||||||
|
} catch (e: ParseException) {
|
||||||
|
0L
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun pageListParse(document: Document): List<Page> {
|
override fun pageListParse(document: Document): List<Page> {
|
||||||
|
@ -318,4 +335,4 @@ class Mangahere : ParsedHttpSource() {
|
||||||
Genre("Lolicon", 36)
|
Genre("Lolicon", 36)
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue