small fix

This commit is contained in:
hexated 2023-09-21 14:50:29 +07:00
parent cdf15ff08a
commit 10b3595c0e
2 changed files with 3 additions and 2 deletions

View file

@ -1338,7 +1338,7 @@ fun isUpcoming(dateString: String?): Boolean {
return try { return try {
val format = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()) val format = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault())
val dateTime = dateString?.let { format.parse(it)?.time } ?: return false val dateTime = dateString?.let { format.parse(it)?.time } ?: return false
return unixTimeMS < dateTime unixTimeMS < dateTime
} catch (t: Throwable) { } catch (t: Throwable) {
logError(t) logError(t)
false false

View file

@ -1,6 +1,7 @@
package com.hexated package com.hexated
import com.lagradost.cloudstream3.APIHolder import com.lagradost.cloudstream3.APIHolder
import com.lagradost.cloudstream3.APIHolder.unixTimeMS
import com.lagradost.cloudstream3.mvvm.logError import com.lagradost.cloudstream3.mvvm.logError
import com.lagradost.nicehttp.Requests.Companion.await import com.lagradost.nicehttp.Requests.Companion.await
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
@ -62,7 +63,7 @@ fun isUpcoming(dateString: String?): Boolean {
return try { return try {
val format = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()) val format = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault())
val dateTime = dateString?.let { format.parse(it)?.time } ?: return false val dateTime = dateString?.let { format.parse(it)?.time } ?: return false
return APIHolder.unixTimeMS < dateTime unixTimeMS < dateTime
} catch (t: Throwable) { } catch (t: Throwable) {
logError(t) logError(t)
false false