neonime: fix unparseable date (#207)
This commit is contained in:
@ -5,7 +5,7 @@ ext {
|
|||||||
extName = 'NeoNime'
|
extName = 'NeoNime'
|
||||||
pkgNameSuffix = 'id.neonime'
|
pkgNameSuffix = 'id.neonime'
|
||||||
extClass = '.NeoNime'
|
extClass = '.NeoNime'
|
||||||
extVersionCode = 3
|
extVersionCode = 4
|
||||||
libVersion = '12'
|
libVersion = '12'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,8 @@ class NeoNime : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
// Private Fun
|
// Private Fun
|
||||||
private fun reconstructDate(Str: String): Long {
|
private fun reconstructDate(Str: String): Long {
|
||||||
val pattern = SimpleDateFormat("dd-MM-yyyy", Locale.US)
|
val pattern = SimpleDateFormat("dd-MM-yyyy", Locale.US)
|
||||||
return pattern.parse(Str)!!.time
|
return runCatching { pattern.parse(Str)?.time }
|
||||||
|
.getOrNull() ?: 0L
|
||||||
}
|
}
|
||||||
private fun parseStatus(statusString: String): Int {
|
private fun parseStatus(statusString: String): Int {
|
||||||
return when {
|
return when {
|
||||||
|
Reference in New Issue
Block a user