Added new date format for readmanga/mintmanga (#724)

Added new date format for readmanga/mintmanga
This commit is contained in:
Taumer 2019-01-12 00:05:09 +03:00 committed by Carlos
parent 75625d6931
commit 0a917249f8
4 changed files with 14 additions and 4 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Mintmanga' appName = 'Tachiyomi: Mintmanga'
pkgNameSuffix = 'ru.mintmanga' pkgNameSuffix = 'ru.mintmanga'
extClass = '.Mintmanga' extClass = '.Mintmanga'
extVersionCode = 8 extVersionCode = 9
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -10,6 +10,7 @@ import okhttp3.Response
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.text.ParseException
import java.util.* import java.util.*
import java.util.regex.Pattern import java.util.regex.Pattern
@ -114,7 +115,11 @@ class Mintmanga : ParsedHttpSource() {
chapter.name = urlText chapter.name = urlText
} }
chapter.date_upload = element.select("td.hidden-xxs").last()?.text()?.let { chapter.date_upload = element.select("td.hidden-xxs").last()?.text()?.let {
try {
SimpleDateFormat("dd/MM/yy", Locale.US).parse(it).time SimpleDateFormat("dd/MM/yy", Locale.US).parse(it).time
} catch (e: ParseException) {
SimpleDateFormat("dd.MM.yy", Locale.US).parse(it).time
}
} ?: 0 } ?: 0
return chapter return chapter
} }

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Readmanga' appName = 'Tachiyomi: Readmanga'
pkgNameSuffix = 'ru.readmanga' pkgNameSuffix = 'ru.readmanga'
extClass = '.Readmanga' extClass = '.Readmanga'
extVersionCode = 8 extVersionCode = 9
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -10,6 +10,7 @@ import okhttp3.Response
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.text.ParseException
import java.util.* import java.util.*
import java.util.regex.Pattern import java.util.regex.Pattern
@ -114,7 +115,11 @@ class Readmanga : ParsedHttpSource() {
chapter.name = urlText chapter.name = urlText
} }
chapter.date_upload = element.select("td.hidden-xxs").last()?.text()?.let { chapter.date_upload = element.select("td.hidden-xxs").last()?.text()?.let {
try {
SimpleDateFormat("dd/MM/yy", Locale.US).parse(it).time SimpleDateFormat("dd/MM/yy", Locale.US).parse(it).time
} catch (e: ParseException) {
SimpleDateFormat("dd.MM.yy", Locale.US).parse(it).time
}
} ?: 0 } ?: 0
return chapter return chapter
} }