mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
973c468b0c
3 changed files with 21 additions and 11 deletions
|
@ -2,12 +2,14 @@ package com.lagradost.cloudstream3.animeproviders
|
|||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty
|
||||
import com.lagradost.cloudstream3.*
|
||||
import org.jsoup.Jsoup
|
||||
import java.util.*
|
||||
import com.lagradost.cloudstream3.mvvm.logError
|
||||
import com.lagradost.cloudstream3.mvvm.safeApiCall
|
||||
import com.lagradost.cloudstream3.utils.*
|
||||
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
import com.lagradost.cloudstream3.utils.M3u8Helper
|
||||
import com.lagradost.cloudstream3.utils.Qualities
|
||||
import com.lagradost.cloudstream3.utils.loadExtractor
|
||||
import org.jsoup.Jsoup
|
||||
|
||||
class GomunimeProvider : MainAPI() {
|
||||
override var mainUrl = "https://185.231.223.76"
|
||||
|
|
|
@ -34,6 +34,7 @@ import androidx.fragment.app.Fragment
|
|||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.navigation.fragment.NavHostFragment
|
||||
import androidx.preference.PreferenceManager
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||
import com.bumptech.glide.load.model.GlideUrl
|
||||
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
|
||||
import com.lagradost.cloudstream3.R
|
||||
|
@ -156,16 +157,20 @@ object UIHelper {
|
|||
errorImageDrawable: Int? = null
|
||||
): Boolean {
|
||||
if (this == null || url.isNullOrBlank()) return false
|
||||
|
||||
return try {
|
||||
val builder = GlideApp.with(this.context)
|
||||
val builder = GlideApp.with(this)
|
||||
.load(GlideUrl(url) { headers ?: emptyMap() }).transition(
|
||||
DrawableTransitionOptions.withCrossFade()
|
||||
)
|
||||
.skipMemoryCache(true)
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
|
||||
if (errorImageDrawable != null)
|
||||
val res = if (errorImageDrawable != null)
|
||||
builder.error(errorImageDrawable).into(this)
|
||||
else
|
||||
builder.into(this)
|
||||
res.clearOnDetach()
|
||||
|
||||
true
|
||||
} catch (e: Exception) {
|
||||
|
@ -182,13 +187,16 @@ object UIHelper {
|
|||
) {
|
||||
if (this == null || url.isNullOrBlank()) return
|
||||
try {
|
||||
GlideApp.with(this.context)
|
||||
val res = GlideApp.with(this)
|
||||
.load(GlideUrl(url) { headers ?: emptyMap() })
|
||||
.apply(bitmapTransform(BlurTransformation(radius, sample)))
|
||||
.transition(
|
||||
DrawableTransitionOptions.withCrossFade()
|
||||
)
|
||||
.skipMemoryCache(true)
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
.into(this)
|
||||
res.clearOnDetach()
|
||||
} catch (e: Exception) {
|
||||
logError(e)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue