MangaTaro: handle days in relative date parsing (#11325)
This commit is contained in:
parent
a2d9686eeb
commit
cd528cde6a
@ -1,7 +1,7 @@
|
|||||||
ext {
|
ext {
|
||||||
extName = 'MangaTaro'
|
extName = 'MangaTaro'
|
||||||
extClass = '.MangaTaro'
|
extClass = '.MangaTaro'
|
||||||
extVersionCode = 3
|
extVersionCode = 4
|
||||||
isNsfw = false
|
isNsfw = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -292,6 +292,7 @@ class MangaTaro : HttpSource() {
|
|||||||
|
|
||||||
when (unit) {
|
when (unit) {
|
||||||
"h" -> calendar.add(Calendar.HOUR, -amount.toInt())
|
"h" -> calendar.add(Calendar.HOUR, -amount.toInt())
|
||||||
|
"d" -> calendar.add(Calendar.DAY_OF_YEAR, -amount.toInt())
|
||||||
"w" -> calendar.add(Calendar.WEEK_OF_YEAR, -amount.toInt())
|
"w" -> calendar.add(Calendar.WEEK_OF_YEAR, -amount.toInt())
|
||||||
"mo" -> calendar.add(Calendar.MONTH, -amount.toInt())
|
"mo" -> calendar.add(Calendar.MONTH, -amount.toInt())
|
||||||
"y" -> calendar.add(Calendar.YEAR, -amount.toInt())
|
"y" -> calendar.add(Calendar.YEAR, -amount.toInt())
|
||||||
@ -300,7 +301,7 @@ class MangaTaro : HttpSource() {
|
|||||||
return calendar.timeInMillis
|
return calendar.timeInMillis
|
||||||
}
|
}
|
||||||
|
|
||||||
private val relativeDateRegex = Regex("""(\d+)(h|w|mo|y) ago""")
|
private val relativeDateRegex = Regex("""(\d+)(h|d|w|mo|y) ago""")
|
||||||
|
|
||||||
override fun imageUrlParse(response: Response): String {
|
override fun imageUrlParse(response: Response): String {
|
||||||
throw UnsupportedOperationException()
|
throw UnsupportedOperationException()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user