Reaper Scans (unoriginal): Fix date parse (#7376)

fix date parse
This commit is contained in:
dngonz 2025-01-28 12:39:14 +01:00 committed by Draff
parent 9a6a106b38
commit 1fb7d1c976
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 3 additions and 2 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = 'Reaper Scans (unoriginal)'
extClass = '.ReaperScansUnoriginal'
extVersionCode = 31
extVersionCode = 32
}
apply from: "$rootDir/common.gradle"

View File

@ -102,7 +102,8 @@ class ReaperScansUnoriginal : ParsedHttpSource() {
}
val trimmedDate = date.split(" ")
if (trimmedDate.size != 3 && trimmedDate[2] != "ago") return 0L
// This means 1hr ago or 20hrs ago
if (trimmedDate.size < 3) return 0L
val number = trimmedDate[0].toIntOrNull() ?: return 0L
val unit = trimmedDate[1].removeSuffix("s") // Remove 's' suffix
val now = Calendar.getInstance()