mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
small fix
This commit is contained in:
parent
cdf15ff08a
commit
10b3595c0e
2 changed files with 3 additions and 2 deletions
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue