Refactor out usage of `* -1` (#6003)

This commit is contained in:
Vetle Ledaal 2024-11-14 07:15:34 +01:00 committed by Draff
parent 098b3133b0
commit 6c28238769
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
15 changed files with 92 additions and 92 deletions

View File

@ -269,32 +269,32 @@ abstract class FMReader(
// languages: en, vi, es, tr // languages: en, vi, es, tr
return when (dateWord) { return when (dateWord) {
"min", "minute", "phút", "minuto", "dakika" -> Calendar.getInstance().apply { "min", "minute", "phút", "minuto", "dakika" -> Calendar.getInstance().apply {
add(Calendar.MINUTE, value * -1) add(Calendar.MINUTE, -value)
set(Calendar.SECOND, 0) set(Calendar.SECOND, 0)
set(Calendar.MILLISECOND, 0) set(Calendar.MILLISECOND, 0)
}.timeInMillis }.timeInMillis
"hour", "giờ", "hora", "saat" -> Calendar.getInstance().apply { "hour", "giờ", "hora", "saat" -> Calendar.getInstance().apply {
add(Calendar.HOUR_OF_DAY, value * -1) add(Calendar.HOUR_OF_DAY, -value)
set(Calendar.SECOND, 0) set(Calendar.SECOND, 0)
set(Calendar.MILLISECOND, 0) set(Calendar.MILLISECOND, 0)
}.timeInMillis }.timeInMillis
"day", "ngày", "día", "gün" -> Calendar.getInstance().apply { "day", "ngày", "día", "gün" -> Calendar.getInstance().apply {
add(Calendar.DATE, value * -1) add(Calendar.DATE, -value)
set(Calendar.SECOND, 0) set(Calendar.SECOND, 0)
set(Calendar.MILLISECOND, 0) set(Calendar.MILLISECOND, 0)
}.timeInMillis }.timeInMillis
"week", "tuần", "semana", "hafta" -> Calendar.getInstance().apply { "week", "tuần", "semana", "hafta" -> Calendar.getInstance().apply {
add(Calendar.DATE, value * 7 * -1) add(Calendar.DATE, -value * 7)
set(Calendar.SECOND, 0) set(Calendar.SECOND, 0)
set(Calendar.MILLISECOND, 0) set(Calendar.MILLISECOND, 0)
}.timeInMillis }.timeInMillis
"month", "tháng", "mes", "ay" -> Calendar.getInstance().apply { "month", "tháng", "mes", "ay" -> Calendar.getInstance().apply {
add(Calendar.MONTH, value * -1) add(Calendar.MONTH, -value)
set(Calendar.SECOND, 0) set(Calendar.SECOND, 0)
set(Calendar.MILLISECOND, 0) set(Calendar.MILLISECOND, 0)
}.timeInMillis }.timeInMillis
"year", "năm", "año", "yıl" -> Calendar.getInstance().apply { "year", "năm", "año", "yıl" -> Calendar.getInstance().apply {
add(Calendar.YEAR, value * -1) add(Calendar.YEAR, -value)
set(Calendar.SECOND, 0) set(Calendar.SECOND, 0)
set(Calendar.MILLISECOND, 0) set(Calendar.MILLISECOND, 0)
}.timeInMillis }.timeInMillis

View File

@ -232,7 +232,7 @@ abstract class HentaiHand(
val date = it.jsonObject["added_at"]!!.jsonPrimitive.content val date = it.jsonObject["added_at"]!!.jsonPrimitive.content
date_upload = if (date.contains("day")) { date_upload = if (date.contains("day")) {
Calendar.getInstance().apply { Calendar.getInstance().apply {
add(Calendar.DATE, date.filter { it.isDigit() }.toInt() * -1) add(Calendar.DATE, -date.filter { it.isDigit() }.toInt())
}.timeInMillis }.timeInMillis
} else { } else {
DATE_FORMAT.parse(it.jsonObject["added_at"]!!.jsonPrimitive.content)?.time ?: 0 DATE_FORMAT.parse(it.jsonObject["added_at"]!!.jsonPrimitive.content)?.time ?: 0
@ -248,7 +248,7 @@ abstract class HentaiHand(
val date = obj.jsonObject["uploaded_at"]!!.jsonPrimitive.content val date = obj.jsonObject["uploaded_at"]!!.jsonPrimitive.content
date_upload = if (date.contains("day")) { date_upload = if (date.contains("day")) {
Calendar.getInstance().apply { Calendar.getInstance().apply {
add(Calendar.DATE, date.filter { it.isDigit() }.toInt() * -1) add(Calendar.DATE, -date.filter { it.isDigit() }.toInt())
}.timeInMillis }.timeInMillis
} else { } else {
DATE_FORMAT.parse(obj.jsonObject["uploaded_at"]!!.jsonPrimitive.content)?.time ?: 0 DATE_FORMAT.parse(obj.jsonObject["uploaded_at"]!!.jsonPrimitive.content)?.time ?: 0

View File

@ -221,9 +221,9 @@ abstract class MangaBox(
val value = date.split(' ')[0].toIntOrNull() val value = date.split(' ')[0].toIntOrNull()
val cal = Calendar.getInstance() val cal = Calendar.getInstance()
when { when {
value != null && "min" in date -> cal.apply { add(Calendar.MINUTE, value * -1) } value != null && "min" in date -> cal.apply { add(Calendar.MINUTE, -value) }
value != null && "hour" in date -> cal.apply { add(Calendar.HOUR_OF_DAY, value * -1) } value != null && "hour" in date -> cal.apply { add(Calendar.HOUR_OF_DAY, -value) }
value != null && "day" in date -> cal.apply { add(Calendar.DATE, value * -1) } value != null && "day" in date -> cal.apply { add(Calendar.DATE, -value) }
else -> null else -> null
}?.timeInMillis }?.timeInMillis
} else { } else {

View File

@ -152,25 +152,25 @@ abstract class Zbulu(
val value = date.split(' ')[0].toInt() val value = date.split(' ')[0].toInt()
when { when {
"second" in date -> Calendar.getInstance().apply { "second" in date -> Calendar.getInstance().apply {
add(Calendar.SECOND, value * -1) add(Calendar.SECOND, -value)
}.timeInMillis }.timeInMillis
"minute" in date -> Calendar.getInstance().apply { "minute" in date -> Calendar.getInstance().apply {
add(Calendar.MINUTE, value * -1) add(Calendar.MINUTE, -value)
}.timeInMillis }.timeInMillis
"hour" in date -> Calendar.getInstance().apply { "hour" in date -> Calendar.getInstance().apply {
add(Calendar.HOUR_OF_DAY, value * -1) add(Calendar.HOUR_OF_DAY, -value)
}.timeInMillis }.timeInMillis
"day" in date -> Calendar.getInstance().apply { "day" in date -> Calendar.getInstance().apply {
add(Calendar.DATE, value * -1) add(Calendar.DATE, -value)
}.timeInMillis }.timeInMillis
"week" in date -> Calendar.getInstance().apply { "week" in date -> Calendar.getInstance().apply {
add(Calendar.DATE, value * 7 * -1) add(Calendar.DATE, -value * 7)
}.timeInMillis }.timeInMillis
"month" in date -> Calendar.getInstance().apply { "month" in date -> Calendar.getInstance().apply {
add(Calendar.MONTH, value * -1) add(Calendar.MONTH, -value)
}.timeInMillis }.timeInMillis
"year" in date -> Calendar.getInstance().apply { "year" in date -> Calendar.getInstance().apply {
add(Calendar.YEAR, value * -1) add(Calendar.YEAR, -value)
}.timeInMillis }.timeInMillis
else -> { else -> {
0L 0L

View File

@ -428,46 +428,46 @@ open class BatoTo(
return when { return when {
"secs" in date -> Calendar.getInstance().apply { "secs" in date -> Calendar.getInstance().apply {
add(Calendar.SECOND, value * -1) add(Calendar.SECOND, -value)
}.timeInMillis }.timeInMillis
"mins" in date -> Calendar.getInstance().apply { "mins" in date -> Calendar.getInstance().apply {
add(Calendar.MINUTE, value * -1) add(Calendar.MINUTE, -value)
}.timeInMillis }.timeInMillis
"hours" in date -> Calendar.getInstance().apply { "hours" in date -> Calendar.getInstance().apply {
add(Calendar.HOUR_OF_DAY, value * -1) add(Calendar.HOUR_OF_DAY, -value)
}.timeInMillis }.timeInMillis
"days" in date -> Calendar.getInstance().apply { "days" in date -> Calendar.getInstance().apply {
add(Calendar.DATE, value * -1) add(Calendar.DATE, -value)
}.timeInMillis }.timeInMillis
"weeks" in date -> Calendar.getInstance().apply { "weeks" in date -> Calendar.getInstance().apply {
add(Calendar.DATE, value * 7 * -1) add(Calendar.DATE, -value * 7)
}.timeInMillis }.timeInMillis
"months" in date -> Calendar.getInstance().apply { "months" in date -> Calendar.getInstance().apply {
add(Calendar.MONTH, value * -1) add(Calendar.MONTH, -value)
}.timeInMillis }.timeInMillis
"years" in date -> Calendar.getInstance().apply { "years" in date -> Calendar.getInstance().apply {
add(Calendar.YEAR, value * -1) add(Calendar.YEAR, -value)
}.timeInMillis }.timeInMillis
"sec" in date -> Calendar.getInstance().apply { "sec" in date -> Calendar.getInstance().apply {
add(Calendar.SECOND, value * -1) add(Calendar.SECOND, -value)
}.timeInMillis }.timeInMillis
"min" in date -> Calendar.getInstance().apply { "min" in date -> Calendar.getInstance().apply {
add(Calendar.MINUTE, value * -1) add(Calendar.MINUTE, -value)
}.timeInMillis }.timeInMillis
"hour" in date -> Calendar.getInstance().apply { "hour" in date -> Calendar.getInstance().apply {
add(Calendar.HOUR_OF_DAY, value * -1) add(Calendar.HOUR_OF_DAY, -value)
}.timeInMillis }.timeInMillis
"day" in date -> Calendar.getInstance().apply { "day" in date -> Calendar.getInstance().apply {
add(Calendar.DATE, value * -1) add(Calendar.DATE, -value)
}.timeInMillis }.timeInMillis
"week" in date -> Calendar.getInstance().apply { "week" in date -> Calendar.getInstance().apply {
add(Calendar.DATE, value * 7 * -1) add(Calendar.DATE, -value * 7)
}.timeInMillis }.timeInMillis
"month" in date -> Calendar.getInstance().apply { "month" in date -> Calendar.getInstance().apply {
add(Calendar.MONTH, value * -1) add(Calendar.MONTH, -value)
}.timeInMillis }.timeInMillis
"year" in date -> Calendar.getInstance().apply { "year" in date -> Calendar.getInstance().apply {
add(Calendar.YEAR, value * -1) add(Calendar.YEAR, -value)
}.timeInMillis }.timeInMillis
else -> { else -> {
return 0 return 0

View File

@ -85,12 +85,12 @@ class Doujins : HttpSource() {
set(Calendar.MINUTE, 0) set(Calendar.MINUTE, 0)
set(Calendar.SECOND, 0) set(Calendar.SECOND, 0)
set(Calendar.MILLISECOND, 0) set(Calendar.MILLISECOND, 0)
add(Calendar.DATE, -1 * PAGE_DAYS * (page - 1)) add(Calendar.DATE, -PAGE_DAYS * (page - 1))
} }
val endDateSec = endDate.timeInMillis / 1000 val endDateSec = endDate.timeInMillis / 1000
val startDateSec = endDate.apply { val startDateSec = endDate.apply {
add(Calendar.DATE, -1 * PAGE_DAYS) add(Calendar.DATE, -PAGE_DAYS)
}.timeInMillis / 1000 }.timeInMillis / 1000
return "$baseUrl/folders?start=$startDateSec&end=$endDateSec" return "$baseUrl/folders?start=$startDateSec&end=$endDateSec"

View File

@ -222,25 +222,25 @@ class Hentai2Read : ParsedHttpSource() {
return when { return when {
"second" in date -> Calendar.getInstance().apply { "second" in date -> Calendar.getInstance().apply {
add(Calendar.SECOND, value * -1) add(Calendar.SECOND, -value)
}.timeInMillis }.timeInMillis
"minute" in date -> Calendar.getInstance().apply { "minute" in date -> Calendar.getInstance().apply {
add(Calendar.MINUTE, value * -1) add(Calendar.MINUTE, -value)
}.timeInMillis }.timeInMillis
"hour" in date -> Calendar.getInstance().apply { "hour" in date -> Calendar.getInstance().apply {
add(Calendar.HOUR_OF_DAY, value * -1) add(Calendar.HOUR_OF_DAY, -value)
}.timeInMillis }.timeInMillis
"day" in date -> Calendar.getInstance().apply { "day" in date -> Calendar.getInstance().apply {
add(Calendar.DATE, value * -1) add(Calendar.DATE, -value)
}.timeInMillis }.timeInMillis
"week" in date -> Calendar.getInstance().apply { "week" in date -> Calendar.getInstance().apply {
add(Calendar.DATE, value * 7 * -1) add(Calendar.DATE, -value * 7)
}.timeInMillis }.timeInMillis
"month" in date -> Calendar.getInstance().apply { "month" in date -> Calendar.getInstance().apply {
add(Calendar.MONTH, value * -1) add(Calendar.MONTH, -value)
}.timeInMillis }.timeInMillis
"year" in date -> Calendar.getInstance().apply { "year" in date -> Calendar.getInstance().apply {
add(Calendar.YEAR, value * -1) add(Calendar.YEAR, -value)
}.timeInMillis }.timeInMillis
else -> { else -> {
return 0 return 0

View File

@ -62,25 +62,25 @@ class ZeroScansHelper {
return when (date.split(' ')[1].removeSuffix("s")) { return when (date.split(' ')[1].removeSuffix("s")) {
"sec" -> Calendar.getInstance().apply { "sec" -> Calendar.getInstance().apply {
add(Calendar.SECOND, value * -1) add(Calendar.SECOND, -value)
}.timeInMillis }.timeInMillis
"min" -> Calendar.getInstance().apply { "min" -> Calendar.getInstance().apply {
add(Calendar.MINUTE, value * -1) add(Calendar.MINUTE, -value)
}.timeInMillis }.timeInMillis
"hour" -> Calendar.getInstance().apply { "hour" -> Calendar.getInstance().apply {
add(Calendar.HOUR_OF_DAY, value * -1) add(Calendar.HOUR_OF_DAY, -value)
}.timeInMillis }.timeInMillis
"day" -> Calendar.getInstance().apply { "day" -> Calendar.getInstance().apply {
add(Calendar.DATE, value * -1) add(Calendar.DATE, -value)
}.timeInMillis }.timeInMillis
"week" -> Calendar.getInstance().apply { "week" -> Calendar.getInstance().apply {
add(Calendar.DATE, value * 7 * -1) add(Calendar.DATE, -value * 7)
}.timeInMillis }.timeInMillis
"month" -> Calendar.getInstance().apply { "month" -> Calendar.getInstance().apply {
add(Calendar.MONTH, value * -1) add(Calendar.MONTH, -value)
}.timeInMillis }.timeInMillis
"year" -> Calendar.getInstance().apply { "year" -> Calendar.getInstance().apply {
add(Calendar.YEAR, value * -1) add(Calendar.YEAR, -value)
}.timeInMillis }.timeInMillis
else -> { else -> {
return 0 return 0

View File

@ -192,32 +192,32 @@ class FuryoSquad : ParsedHttpSource() {
return if (value != null) { return if (value != null) {
when (date.split(" ")[4]) { when (date.split(" ")[4]) {
"minute", "minutes" -> Calendar.getInstance().apply { "minute", "minutes" -> Calendar.getInstance().apply {
add(Calendar.MINUTE, value * -1) add(Calendar.MINUTE, -value)
set(Calendar.SECOND, 0) set(Calendar.SECOND, 0)
set(Calendar.MILLISECOND, 0) set(Calendar.MILLISECOND, 0)
}.timeInMillis }.timeInMillis
"heure", "heures" -> Calendar.getInstance().apply { "heure", "heures" -> Calendar.getInstance().apply {
add(Calendar.HOUR_OF_DAY, value * -1) add(Calendar.HOUR_OF_DAY, -value)
set(Calendar.SECOND, 0) set(Calendar.SECOND, 0)
set(Calendar.MILLISECOND, 0) set(Calendar.MILLISECOND, 0)
}.timeInMillis }.timeInMillis
"jour", "jours" -> Calendar.getInstance().apply { "jour", "jours" -> Calendar.getInstance().apply {
add(Calendar.DATE, value * -1) add(Calendar.DATE, -value)
set(Calendar.SECOND, 0) set(Calendar.SECOND, 0)
set(Calendar.MILLISECOND, 0) set(Calendar.MILLISECOND, 0)
}.timeInMillis }.timeInMillis
"semaine", "semaines" -> Calendar.getInstance().apply { "semaine", "semaines" -> Calendar.getInstance().apply {
add(Calendar.DATE, value * 7 * -1) add(Calendar.DATE, -value * 7)
set(Calendar.SECOND, 0) set(Calendar.SECOND, 0)
set(Calendar.MILLISECOND, 0) set(Calendar.MILLISECOND, 0)
}.timeInMillis }.timeInMillis
"mois" -> Calendar.getInstance().apply { "mois" -> Calendar.getInstance().apply {
add(Calendar.MONTH, value * -1) add(Calendar.MONTH, -value)
set(Calendar.SECOND, 0) set(Calendar.SECOND, 0)
set(Calendar.MILLISECOND, 0) set(Calendar.MILLISECOND, 0)
}.timeInMillis }.timeInMillis
"an", "ans", "année", "années" -> Calendar.getInstance().apply { "an", "ans", "année", "années" -> Calendar.getInstance().apply {
add(Calendar.YEAR, value * -1) add(Calendar.YEAR, -value)
set(Calendar.SECOND, 0) set(Calendar.SECOND, 0)
set(Calendar.MILLISECOND, 0) set(Calendar.MILLISECOND, 0)
}.timeInMillis }.timeInMillis

View File

@ -140,25 +140,25 @@ class BacaKomik : ParsedHttpSource() {
val value = date.split(' ')[0].toInt() val value = date.split(' ')[0].toInt()
when { when {
"detik" in date -> Calendar.getInstance().apply { "detik" in date -> Calendar.getInstance().apply {
add(Calendar.SECOND, value * -1) add(Calendar.SECOND, -value)
}.timeInMillis }.timeInMillis
"menit" in date -> Calendar.getInstance().apply { "menit" in date -> Calendar.getInstance().apply {
add(Calendar.MINUTE, value * -1) add(Calendar.MINUTE, -value)
}.timeInMillis }.timeInMillis
"jam" in date -> Calendar.getInstance().apply { "jam" in date -> Calendar.getInstance().apply {
add(Calendar.HOUR_OF_DAY, value * -1) add(Calendar.HOUR_OF_DAY, -value)
}.timeInMillis }.timeInMillis
"hari" in date -> Calendar.getInstance().apply { "hari" in date -> Calendar.getInstance().apply {
add(Calendar.DATE, value * -1) add(Calendar.DATE, -value)
}.timeInMillis }.timeInMillis
"minggu" in date -> Calendar.getInstance().apply { "minggu" in date -> Calendar.getInstance().apply {
add(Calendar.DATE, value * 7 * -1) add(Calendar.DATE, -value * 7)
}.timeInMillis }.timeInMillis
"bulan" in date -> Calendar.getInstance().apply { "bulan" in date -> Calendar.getInstance().apply {
add(Calendar.MONTH, value * -1) add(Calendar.MONTH, -value)
}.timeInMillis }.timeInMillis
"tahun" in date -> Calendar.getInstance().apply { "tahun" in date -> Calendar.getInstance().apply {
add(Calendar.YEAR, value * -1) add(Calendar.YEAR, -value)
}.timeInMillis }.timeInMillis
else -> { else -> {
0L 0L

View File

@ -107,22 +107,22 @@ class KomikCast : MangaThemesia("Komik Cast", "https://komikcast.cz", "id", "/da
val value = date.split(' ')[0].toInt() val value = date.split(' ')[0].toInt()
when { when {
"min" in date -> Calendar.getInstance().apply { "min" in date -> Calendar.getInstance().apply {
add(Calendar.MINUTE, value * -1) add(Calendar.MINUTE, -value)
}.timeInMillis }.timeInMillis
"hour" in date -> Calendar.getInstance().apply { "hour" in date -> Calendar.getInstance().apply {
add(Calendar.HOUR_OF_DAY, value * -1) add(Calendar.HOUR_OF_DAY, -value)
}.timeInMillis }.timeInMillis
"day" in date -> Calendar.getInstance().apply { "day" in date -> Calendar.getInstance().apply {
add(Calendar.DATE, value * -1) add(Calendar.DATE, -value)
}.timeInMillis }.timeInMillis
"week" in date -> Calendar.getInstance().apply { "week" in date -> Calendar.getInstance().apply {
add(Calendar.DATE, value * 7 * -1) add(Calendar.DATE, -value * 7)
}.timeInMillis }.timeInMillis
"month" in date -> Calendar.getInstance().apply { "month" in date -> Calendar.getInstance().apply {
add(Calendar.MONTH, value * -1) add(Calendar.MONTH, -value)
}.timeInMillis }.timeInMillis
"year" in date -> Calendar.getInstance().apply { "year" in date -> Calendar.getInstance().apply {
add(Calendar.YEAR, value * -1) add(Calendar.YEAR, -value)
}.timeInMillis }.timeInMillis
else -> { else -> {
0L 0L

View File

@ -170,25 +170,25 @@ class KomikIndoID : ParsedHttpSource() {
val value = date.split(' ')[0].toInt() val value = date.split(' ')[0].toInt()
when { when {
"detik" in date -> Calendar.getInstance().apply { "detik" in date -> Calendar.getInstance().apply {
add(Calendar.SECOND, value * -1) add(Calendar.SECOND, -value)
}.timeInMillis }.timeInMillis
"menit" in date -> Calendar.getInstance().apply { "menit" in date -> Calendar.getInstance().apply {
add(Calendar.MINUTE, value * -1) add(Calendar.MINUTE, -value)
}.timeInMillis }.timeInMillis
"jam" in date -> Calendar.getInstance().apply { "jam" in date -> Calendar.getInstance().apply {
add(Calendar.HOUR_OF_DAY, value * -1) add(Calendar.HOUR_OF_DAY, -value)
}.timeInMillis }.timeInMillis
"hari" in date -> Calendar.getInstance().apply { "hari" in date -> Calendar.getInstance().apply {
add(Calendar.DATE, value * -1) add(Calendar.DATE, -value)
}.timeInMillis }.timeInMillis
"minggu" in date -> Calendar.getInstance().apply { "minggu" in date -> Calendar.getInstance().apply {
add(Calendar.DATE, value * 7 * -1) add(Calendar.DATE, -value * 7)
}.timeInMillis }.timeInMillis
"bulan" in date -> Calendar.getInstance().apply { "bulan" in date -> Calendar.getInstance().apply {
add(Calendar.MONTH, value * -1) add(Calendar.MONTH, -value)
}.timeInMillis }.timeInMillis
"tahun" in date -> Calendar.getInstance().apply { "tahun" in date -> Calendar.getInstance().apply {
add(Calendar.YEAR, value * -1) add(Calendar.YEAR, -value)
}.timeInMillis }.timeInMillis
else -> { else -> {
0L 0L

View File

@ -49,12 +49,12 @@ class KissLove : FMReader("KissLove", "https://klz9.com", "ja") {
} }
when (date.split(' ')[dateWordIndex]) { when (date.split(' ')[dateWordIndex]) {
"mins", "minutes" -> chapterDate.add(Calendar.MINUTE, value * -1) "mins", "minutes" -> chapterDate.add(Calendar.MINUTE, -value)
"hours" -> chapterDate.add(Calendar.HOUR_OF_DAY, value * -1) "hours" -> chapterDate.add(Calendar.HOUR_OF_DAY, -value)
"days" -> chapterDate.add(Calendar.DATE, value * -1) "days" -> chapterDate.add(Calendar.DATE, -value)
"weeks" -> chapterDate.add(Calendar.DATE, value * 7 * -1) "weeks" -> chapterDate.add(Calendar.DATE, -value * 7)
"months" -> chapterDate.add(Calendar.MONTH, value * -1) "months" -> chapterDate.add(Calendar.MONTH, -value)
"years" -> chapterDate.add(Calendar.YEAR, value * -1) "years" -> chapterDate.add(Calendar.YEAR, -value)
else -> return 0 else -> return 0
} }

View File

@ -60,12 +60,12 @@ class MangaGun : FMReader("MangaGun", "https://$DOMAIN", "ja") {
} }
when (date.split(' ')[dateWordIndex]) { when (date.split(' ')[dateWordIndex]) {
"mins", "minutes" -> chapterDate.add(Calendar.MINUTE, value * -1) "mins", "minutes" -> chapterDate.add(Calendar.MINUTE, -value)
"hours" -> chapterDate.add(Calendar.HOUR_OF_DAY, value * -1) "hours" -> chapterDate.add(Calendar.HOUR_OF_DAY, -value)
"days" -> chapterDate.add(Calendar.DATE, value * -1) "days" -> chapterDate.add(Calendar.DATE, -value)
"weeks" -> chapterDate.add(Calendar.DATE, value * 7 * -1) "weeks" -> chapterDate.add(Calendar.DATE, -value * 7)
"months" -> chapterDate.add(Calendar.MONTH, value * -1) "months" -> chapterDate.add(Calendar.MONTH, -value)
"years" -> chapterDate.add(Calendar.YEAR, value * -1) "years" -> chapterDate.add(Calendar.YEAR, -value)
else -> return 0 else -> return 0
} }

View File

@ -46,12 +46,12 @@ class WeLoveMangaOne : FMReader("WeLoveMangaOne", "https://welovemanga.one", "ja
} }
when (date.split(' ')[dateWordIndex]) { when (date.split(' ')[dateWordIndex]) {
"mins", "minutes" -> chapterDate.add(Calendar.MINUTE, value * -1) "mins", "minutes" -> chapterDate.add(Calendar.MINUTE, -value)
"hours" -> chapterDate.add(Calendar.HOUR_OF_DAY, value * -1) "hours" -> chapterDate.add(Calendar.HOUR_OF_DAY, -value)
"days" -> chapterDate.add(Calendar.DATE, value * -1) "days" -> chapterDate.add(Calendar.DATE, -value)
"weeks" -> chapterDate.add(Calendar.DATE, value * 7 * -1) "weeks" -> chapterDate.add(Calendar.DATE, -value * 7)
"months" -> chapterDate.add(Calendar.MONTH, value * -1) "months" -> chapterDate.add(Calendar.MONTH, -value)
"years" -> chapterDate.add(Calendar.YEAR, value * -1) "years" -> chapterDate.add(Calendar.YEAR, -value)
else -> return 0 else -> return 0
} }