loklok: fix search

This commit is contained in:
hexated 2023-03-18 01:18:50 +07:00
parent 39df95bf96
commit fa8fc96ab6
3 changed files with 34 additions and 30 deletions

View file

@ -490,8 +490,10 @@ suspend fun getSoraIdAndType(title: String?, year: Int?, season: Int?) : Pair<St
}
}
val id = script?.third?.last() ?: return null
val type = script.third?.get(2) ?: return null
val id = script?.third?.last()?.substringBefore("-") ?: return null
val type = script.third?.get(2)?.let {
if (it == "drama") "1" else "0"
} ?: return null
return id to type
}