forked from recloudstream/cloudstream
(hopefully) Fix home search and OpenSubtitles
This commit is contained in:
parent
60aca3ebdc
commit
0b4de81811
2 changed files with 4 additions and 7 deletions
|
@ -166,7 +166,7 @@ class OpenSubtitlesApi(index: Int) : InAppAuthAPIManager(index), AbstractSubApi
|
|||
val fixedLang = fixLanguage(query.lang)
|
||||
|
||||
val imdbId = query.imdb ?: 0
|
||||
val queryText = query.query.replace(" ", "+")
|
||||
val queryText = query.query
|
||||
val epNum = query.epNumber ?: 0
|
||||
val seasonNum = query.seasonNumber ?: 0
|
||||
val yearNum = query.year ?: 0
|
||||
|
@ -177,7 +177,7 @@ class OpenSubtitlesApi(index: Int) : InAppAuthAPIManager(index), AbstractSubApi
|
|||
val searchQueryUrl = when (imdbId > 0) {
|
||||
//Use imdb_id to search if its valid
|
||||
true -> "$host/subtitles?imdb_id=$imdbId&languages=${fixedLang}$yearQuery$epQuery$seasonQuery"
|
||||
false -> "$host/subtitles?query=${URLEncoder.encode(queryText.lowercase(), StandardCharsets.UTF_8.toString())}&languages=${fixedLang}$yearQuery$epQuery$seasonQuery"
|
||||
false -> "$host/subtitles?query=${queryText}&languages=${fixedLang}$yearQuery$epQuery$seasonQuery"
|
||||
}
|
||||
|
||||
val req = app.get(
|
||||
|
|
|
@ -16,10 +16,8 @@
|
|||
|
||||
<FrameLayout
|
||||
android:id="@+id/home_preview"
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="500dp"
|
||||
tools:visibility="gone">
|
||||
android:layout_height="500dp">
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/home_preview_viewpager"
|
||||
|
@ -47,7 +45,7 @@
|
|||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/home_search"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="60dp"
|
||||
android:layout_gravity="start"
|
||||
android:editTextColor="@color/white"
|
||||
android:gravity="start"
|
||||
|
@ -58,7 +56,6 @@
|
|||
app:iconifiedByDefault="true"
|
||||
app:queryBackground="@color/transparent"
|
||||
app:queryHint="@string/search_hint"
|
||||
|
||||
app:searchIcon="@drawable/search_icon"
|
||||
tools:ignore="RtlSymmetry" />
|
||||
</LinearLayout>
|
||||
|
|
Loading…
Reference in a new issue