zBulu - fix date parsing (#3951)
This commit is contained in:
parent
ff635bd624
commit
ee1db2fbb7
@ -5,7 +5,7 @@ ext {
|
|||||||
extName = 'zBulu'
|
extName = 'zBulu'
|
||||||
pkgNameSuffix = 'all.zbulu'
|
pkgNameSuffix = 'all.zbulu'
|
||||||
extClass = '.ZbuluFactory'
|
extClass = '.ZbuluFactory'
|
||||||
extVersionCode = 1
|
extVersionCode = 2
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ abstract class Zbulu(
|
|||||||
setUrlWithoutDomain(it.attr("href").addTrailingSlash())
|
setUrlWithoutDomain(it.attr("href").addTrailingSlash())
|
||||||
name = it.text()
|
name = it.text()
|
||||||
}
|
}
|
||||||
date_upload = element.select("div.chapter-date")?.text()?.let { parseChapterDate(it) } ?: 0
|
date_upload = element.select("div.chapter-date")?.text().toDate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,8 +161,12 @@ abstract class Zbulu(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun parseChapterDate(string: String): Long {
|
private fun String?.toDate(): Long {
|
||||||
return dateFormat.parse(string).time
|
return if (this.isNullOrEmpty()) {
|
||||||
|
0
|
||||||
|
} else {
|
||||||
|
dateFormat.parse(this)?.time ?: 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pages
|
// Pages
|
||||||
|
Loading…
x
Reference in New Issue
Block a user