mirror of
https://github.com/recloudstream/cloudstream-extensions-multilingual.git
synced 2024-08-15 03:15:14 +00:00
add fuzzy for computing string distance
This commit is contained in:
parent
487da69efd
commit
6785df1f8f
2 changed files with 11 additions and 9 deletions
|
@ -28,15 +28,6 @@ class NekoSamaProvider : MainAPI() {
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
|
||||||
data class Genre(
|
|
||||||
@JsonProperty("0") val action: String,
|
|
||||||
@JsonProperty("1") val adventure: String,
|
|
||||||
@JsonProperty("2") val drama: String?,
|
|
||||||
@JsonProperty("3") val fantasy: String?,
|
|
||||||
@JsonProperty("4") val military: String?,
|
|
||||||
@JsonProperty("5") val shounen: String,
|
|
||||||
)
|
|
||||||
|
|
||||||
private fun List<EpisodeData>.sortByQuery(query: String?): List<EpisodeData> {
|
private fun List<EpisodeData>.sortByQuery(query: String?): List<EpisodeData> {
|
||||||
return if (query == null) {
|
return if (query == null) {
|
||||||
// Return list to base state if no query
|
// Return list to base state if no query
|
||||||
|
@ -60,6 +51,15 @@ class NekoSamaProvider : MainAPI() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data class Genre(
|
||||||
|
@JsonProperty("0") val action: String,
|
||||||
|
@JsonProperty("1") val adventure: String,
|
||||||
|
@JsonProperty("2") val drama: String?,
|
||||||
|
@JsonProperty("3") val fantasy: String?,
|
||||||
|
@JsonProperty("4") val military: String?,
|
||||||
|
@JsonProperty("5") val shounen: String,
|
||||||
|
)
|
||||||
|
|
||||||
data class EpisodeData(
|
data class EpisodeData(
|
||||||
@JsonProperty("id") val id: Int?,
|
@JsonProperty("id") val id: Int?,
|
||||||
@JsonProperty("title") val title: String?,
|
@JsonProperty("title") val title: String?,
|
||||||
|
|
|
@ -84,6 +84,8 @@ subprojects {
|
||||||
|
|
||||||
//run JS
|
//run JS
|
||||||
implementation("org.mozilla:rhino:1.7.14")
|
implementation("org.mozilla:rhino:1.7.14")
|
||||||
|
// Library/extensions searching with Levenshtein distance
|
||||||
|
implementation ("me.xdrop:fuzzywuzzy:1.4.0")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue