mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
fix merge issue
This commit is contained in:
parent
ff7b468f54
commit
08af1d98be
1 changed files with 17 additions and 11 deletions
|
@ -22,8 +22,6 @@ import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
|
|||
import com.lagradost.cloudstream3.LoadResponse.Companion.getAniListId
|
||||
import com.lagradost.cloudstream3.LoadResponse.Companion.getMalId
|
||||
import com.lagradost.cloudstream3.LoadResponse.Companion.isMovie
|
||||
import com.lagradost.cloudstream3.animeproviders.GogoanimeProvider
|
||||
import com.lagradost.cloudstream3.animeproviders.NineAnimeProvider
|
||||
import com.lagradost.cloudstream3.metaproviders.SyncRedirector
|
||||
import com.lagradost.cloudstream3.mvvm.*
|
||||
import com.lagradost.cloudstream3.syncproviders.SyncAPI
|
||||
|
@ -1251,12 +1249,13 @@ class ResultViewModel2 : ViewModel() {
|
|||
}
|
||||
|
||||
val realRecommendations = ArrayList<SearchResponse>()
|
||||
val apiNames = listOf(GogoanimeProvider().name, NineAnimeProvider().name)
|
||||
meta.recommendations?.forEach { rec ->
|
||||
apiNames.forEach { name ->
|
||||
realRecommendations.add(rec.copy(apiName = name))
|
||||
}
|
||||
}
|
||||
// TODO: fix
|
||||
//val apiNames = listOf(GogoanimeProvider().name, NineAnimeProvider().name)
|
||||
// meta.recommendations?.forEach { rec ->
|
||||
// apiNames.forEach { name ->
|
||||
// realRecommendations.add(rec.copy(apiName = name))
|
||||
// }
|
||||
// }
|
||||
|
||||
recommendations = recommendations?.union(realRecommendations)?.toList()
|
||||
?: realRecommendations
|
||||
|
@ -1856,13 +1855,20 @@ class ResultViewModel2 : ViewModel() {
|
|||
|
||||
|
||||
// validate url
|
||||
val validUrlResource = safeApiCall {
|
||||
var validUrlResource = safeApiCall {
|
||||
SyncRedirector.redirect(
|
||||
url,
|
||||
api.mainUrl.replace(NineAnimeProvider().mainUrl, "9anime")
|
||||
.replace(GogoanimeProvider().mainUrl, "gogoanime")
|
||||
api.mainUrl
|
||||
)
|
||||
}
|
||||
// TODO: fix
|
||||
// val validUrlResource = safeApiCall {
|
||||
// SyncRedirector.redirect(
|
||||
// url,
|
||||
// api.mainUrl.replace(NineAnimeProvider().mainUrl, "9anime")
|
||||
// .replace(GogoanimeProvider().mainUrl, "gogoanime")
|
||||
// )
|
||||
// }
|
||||
if (validUrlResource !is Resource.Success) {
|
||||
if (validUrlResource is Resource.Failure) {
|
||||
_page.postValue(validUrlResource)
|
||||
|
|
Loading…
Reference in a new issue