mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
parent
7ebdfeb3e0
commit
cdf15ff08a
11 changed files with 98 additions and 29 deletions
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 10
|
||||
version = 11
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.hexated
|
||||
|
||||
import com.lagradost.cloudstream3.APIHolder
|
||||
import com.lagradost.cloudstream3.mvvm.logError
|
||||
import com.lagradost.nicehttp.Requests.Companion.await
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Request
|
||||
|
@ -58,10 +59,15 @@ fun getEpisodeSlug(
|
|||
}
|
||||
|
||||
fun isUpcoming(dateString: String?): Boolean {
|
||||
if (dateString == null) return false
|
||||
val format = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault())
|
||||
val dateTime = format.parse(dateString)?.time ?: return false
|
||||
return APIHolder.unixTimeMS < dateTime
|
||||
return try {
|
||||
val format = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault())
|
||||
val dateTime = dateString?.let { format.parse(it)?.time } ?: return false
|
||||
return APIHolder.unixTimeMS < dateTime
|
||||
} catch (t: Throwable) {
|
||||
logError(t)
|
||||
false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun fixUrl(url: String, domain: String): String {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue