forked from recloudstream/cloudstream
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.getAniListId
|
||||||
import com.lagradost.cloudstream3.LoadResponse.Companion.getMalId
|
import com.lagradost.cloudstream3.LoadResponse.Companion.getMalId
|
||||||
import com.lagradost.cloudstream3.LoadResponse.Companion.isMovie
|
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.metaproviders.SyncRedirector
|
||||||
import com.lagradost.cloudstream3.mvvm.*
|
import com.lagradost.cloudstream3.mvvm.*
|
||||||
import com.lagradost.cloudstream3.syncproviders.SyncAPI
|
import com.lagradost.cloudstream3.syncproviders.SyncAPI
|
||||||
|
@ -1251,12 +1249,13 @@ class ResultViewModel2 : ViewModel() {
|
||||||
}
|
}
|
||||||
|
|
||||||
val realRecommendations = ArrayList<SearchResponse>()
|
val realRecommendations = ArrayList<SearchResponse>()
|
||||||
val apiNames = listOf(GogoanimeProvider().name, NineAnimeProvider().name)
|
// TODO: fix
|
||||||
meta.recommendations?.forEach { rec ->
|
//val apiNames = listOf(GogoanimeProvider().name, NineAnimeProvider().name)
|
||||||
apiNames.forEach { name ->
|
// meta.recommendations?.forEach { rec ->
|
||||||
realRecommendations.add(rec.copy(apiName = name))
|
// apiNames.forEach { name ->
|
||||||
}
|
// realRecommendations.add(rec.copy(apiName = name))
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
recommendations = recommendations?.union(realRecommendations)?.toList()
|
recommendations = recommendations?.union(realRecommendations)?.toList()
|
||||||
?: realRecommendations
|
?: realRecommendations
|
||||||
|
@ -1856,13 +1855,20 @@ class ResultViewModel2 : ViewModel() {
|
||||||
|
|
||||||
|
|
||||||
// validate url
|
// validate url
|
||||||
val validUrlResource = safeApiCall {
|
var validUrlResource = safeApiCall {
|
||||||
SyncRedirector.redirect(
|
SyncRedirector.redirect(
|
||||||
url,
|
url,
|
||||||
api.mainUrl.replace(NineAnimeProvider().mainUrl, "9anime")
|
api.mainUrl
|
||||||
.replace(GogoanimeProvider().mainUrl, "gogoanime")
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
// 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.Success) {
|
||||||
if (validUrlResource is Resource.Failure) {
|
if (validUrlResource is Resource.Failure) {
|
||||||
_page.postValue(validUrlResource)
|
_page.postValue(validUrlResource)
|
||||||
|
|
Loading…
Reference in a new issue