unimay: Fix search
This commit is contained in:
parent
bf4fbc5d6c
commit
b364b39587
3 changed files with 32 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 4
|
version = 5
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
language = "uk"
|
language = "uk"
|
||||||
|
|
|
@ -21,6 +21,7 @@ import com.lagradost.cloudstream3.newHomePageResponse
|
||||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||||
import com.lagradost.cloudstream3.utils.M3u8Helper
|
import com.lagradost.cloudstream3.utils.M3u8Helper
|
||||||
import com.lagradost.models.Releases
|
import com.lagradost.models.Releases
|
||||||
|
import com.lagradost.models.SearchGet
|
||||||
import com.lagradost.models.SearchModel
|
import com.lagradost.models.SearchModel
|
||||||
|
|
||||||
class UnimayProvider : MainAPI() {
|
class UnimayProvider : MainAPI() {
|
||||||
|
@ -40,6 +41,8 @@ class UnimayProvider : MainAPI() {
|
||||||
private val findUrl = "$apiUrl/v1/release/search?title="
|
private val findUrl = "$apiUrl/v1/release/search?title="
|
||||||
private val imagesUrl = "$apiUrl/storage/images/"
|
private val imagesUrl = "$apiUrl/storage/images/"
|
||||||
|
|
||||||
|
private val TAG = name
|
||||||
|
|
||||||
// Sections
|
// Sections
|
||||||
override val mainPage = mainPageOf(
|
override val mainPage = mainPageOf(
|
||||||
"$apiUrl/api/release/all?page=" to "Останні релізи",
|
"$apiUrl/api/release/all?page=" to "Останні релізи",
|
||||||
|
@ -61,10 +64,10 @@ class UnimayProvider : MainAPI() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun search(query: String): List<SearchResponse> {
|
override suspend fun search(query: String): List<SearchResponse> {
|
||||||
return app.get("$findUrl$query&page=1").parsedSafe<Releases>()!!.releases.map{
|
return app.get("$findUrl$query&page=0").parsedSafe<SearchGet>()!!.content.map{
|
||||||
newAnimeSearchResponse(it.name, "$apiUrl/api/release/${it.code}", TvType.Anime) {
|
newAnimeSearchResponse(it.names.ukr, "$apiUrl/v1/release/${it.code}", TvType.Anime) {
|
||||||
this.posterUrl = "$imagesUrl${it.imageId}"
|
this.posterUrl = "$imagesUrl${it.images.poster}"
|
||||||
addDubStatus("${it.playlistSize}/${it.episodes}", it.playlistSize)
|
addDubStatus("${it.playlistSize}/${it.playlistSize}", it.playlistSize)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,4 +27,28 @@ data class Playlist (
|
||||||
val playlist : String,
|
val playlist : String,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
data class SearchGet (
|
||||||
|
val content : List<Content>,
|
||||||
|
)
|
||||||
|
|
||||||
|
data class Content (
|
||||||
|
|
||||||
|
val id : Int,
|
||||||
|
val playlistSize : Int,
|
||||||
|
val code : String,
|
||||||
|
val names : Names,
|
||||||
|
val images : Images,
|
||||||
|
)
|
||||||
|
|
||||||
|
data class Images (
|
||||||
|
|
||||||
|
val banner : Int?,
|
||||||
|
val poster : Int
|
||||||
|
)
|
||||||
|
|
||||||
|
data class Names (
|
||||||
|
|
||||||
|
val romaji : String,
|
||||||
|
val ukr : String,
|
||||||
|
val eng : String
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in a new issue