stremiox: fix duplicate in search

This commit is contained in:
hexated 2023-04-04 14:01:15 +07:00
parent 2227e4520a
commit 0165d0a031
2 changed files with 4 additions and 4 deletions

View file

@ -1,5 +1,5 @@
// use an integer for version numbers
version = 6
version = 7
cloudstream {

View file

@ -43,10 +43,10 @@ class StremioC : MainAPI() {
mainUrl = mainUrl.fixSourceUrl()
val res = tryParseJson<Manifest>(app.get("${mainUrl}/manifest.json").text) ?: return null
val list = mutableListOf<SearchResponse>()
res.catalogs.forEach { catalog ->
res.catalogs.apmap { catalog ->
list.addAll(catalog.search(query, this))
}
return list
return list.distinct()
}
override suspend fun load(url: String): LoadResponse? {
@ -160,7 +160,7 @@ class StremioC : MainAPI() {
entries.add(entry.toSearchResponse(provider))
}
}
return entries.distinctBy { it.id }
return entries
}
suspend fun toHomePageList(provider: StremioC): HomePageList? {