mirror of
https://github.com/recloudstream/cloudstream-extensions-multilingual.git
synced 2024-08-15 03:15:14 +00:00
add some info and improve search func
This commit is contained in:
parent
d7a3f2c1ce
commit
c18ecfc3c3
1 changed files with 16 additions and 10 deletions
|
@ -69,8 +69,8 @@ class NekosamaProvider : MainAPI() {
|
|||
// Sorted by the best title matching
|
||||
val titlesSorted = titles.sortedBy { it ->
|
||||
-FuzzySearch.ratio(
|
||||
it?.take(query.length + nCharQuery),
|
||||
query
|
||||
it?.lowercase()?.take(query.length + nCharQuery),
|
||||
query.lowercase()
|
||||
)
|
||||
}
|
||||
return titlesSorted.elementAt(0)
|
||||
|
@ -88,8 +88,9 @@ class NekosamaProvider : MainAPI() {
|
|||
this.sortedBy {
|
||||
val bestTitleMatching = it.titleObtainedBysortByQuery(query)
|
||||
-FuzzySearch.ratio(
|
||||
bestTitleMatching?.take(query.length + nCharQuery) ?: bestTitleMatching,
|
||||
query
|
||||
bestTitleMatching?.lowercase()?.take(query.length + nCharQuery)
|
||||
?: bestTitleMatching?.lowercase(),
|
||||
query.lowercase()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -104,7 +105,10 @@ class NekosamaProvider : MainAPI() {
|
|||
|
||||
this.sortedBy {
|
||||
val name = it.name
|
||||
-FuzzySearch.ratio(name.take(query.length + nCharQuery), query)
|
||||
-FuzzySearch.ratio(
|
||||
name.lowercase().take(query.length + nCharQuery),
|
||||
query.lowercase()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -140,13 +144,14 @@ class NekosamaProvider : MainAPI() {
|
|||
|
||||
when (type) {
|
||||
"m0v1e", "special" -> (
|
||||
listofResults.add(newMovieSearchResponse( // réponse du film qui sera ajoutée à la liste apmap qui sera ensuite return
|
||||
listofResults.add(newAnimeSearchResponse( // réponse du film qui sera ajoutée à la liste apmap qui sera ensuite return
|
||||
title,
|
||||
href,
|
||||
TvType.AnimeMovie,
|
||||
false
|
||||
) {
|
||||
this.posterUrl = mediaPoster
|
||||
this.dubStatus = EnumSet.of(dubStatus)
|
||||
}
|
||||
))
|
||||
null, "tv", "ova", "" -> (
|
||||
|
@ -392,13 +397,14 @@ class NekosamaProvider : MainAPI() {
|
|||
|
||||
} else // a movie
|
||||
{
|
||||
return newMovieSearchResponse(
|
||||
return newAnimeSearchResponse(
|
||||
title,
|
||||
link,
|
||||
TvType.AnimeMovie,
|
||||
false,
|
||||
) {
|
||||
this.posterUrl = posterUrl
|
||||
this.dubStatus = EnumSet.of(dubStatus)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue