neonime: fix unparseable date (#207)

This commit is contained in:
Moon Light「つかり」
2021-12-30 02:13:16 +07:00
committed by GitHub
parent ec94f59cd6
commit 6d0c1fd419
2 changed files with 3 additions and 2 deletions

View File

@ -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'
} }

View File

@ -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 {