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 fixedLang = fixLanguage(query.lang)
|
||||||
|
|
||||||
val imdbId = query.imdb ?: 0
|
val imdbId = query.imdb ?: 0
|
||||||
val queryText = query.query.replace(" ", "+")
|
val queryText = query.query
|
||||||
val epNum = query.epNumber ?: 0
|
val epNum = query.epNumber ?: 0
|
||||||
val seasonNum = query.seasonNumber ?: 0
|
val seasonNum = query.seasonNumber ?: 0
|
||||||
val yearNum = query.year ?: 0
|
val yearNum = query.year ?: 0
|
||||||
|
@ -177,7 +177,7 @@ class OpenSubtitlesApi(index: Int) : InAppAuthAPIManager(index), AbstractSubApi
|
||||||
val searchQueryUrl = when (imdbId > 0) {
|
val searchQueryUrl = when (imdbId > 0) {
|
||||||
//Use imdb_id to search if its valid
|
//Use imdb_id to search if its valid
|
||||||
true -> "$host/subtitles?imdb_id=$imdbId&languages=${fixedLang}$yearQuery$epQuery$seasonQuery"
|
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(
|
val req = app.get(
|
||||||
|
|
|
@ -16,10 +16,8 @@
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/home_preview"
|
android:id="@+id/home_preview"
|
||||||
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="500dp"
|
android:layout_height="500dp">
|
||||||
tools:visibility="gone">
|
|
||||||
|
|
||||||
<androidx.viewpager2.widget.ViewPager2
|
<androidx.viewpager2.widget.ViewPager2
|
||||||
android:id="@+id/home_preview_viewpager"
|
android:id="@+id/home_preview_viewpager"
|
||||||
|
@ -47,7 +45,7 @@
|
||||||
<androidx.appcompat.widget.SearchView
|
<androidx.appcompat.widget.SearchView
|
||||||
android:id="@+id/home_search"
|
android:id="@+id/home_search"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="60dp"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
android:editTextColor="@color/white"
|
android:editTextColor="@color/white"
|
||||||
android:gravity="start"
|
android:gravity="start"
|
||||||
|
@ -58,7 +56,6 @@
|
||||||
app:iconifiedByDefault="true"
|
app:iconifiedByDefault="true"
|
||||||
app:queryBackground="@color/transparent"
|
app:queryBackground="@color/transparent"
|
||||||
app:queryHint="@string/search_hint"
|
app:queryHint="@string/search_hint"
|
||||||
|
|
||||||
app:searchIcon="@drawable/search_icon"
|
app:searchIcon="@drawable/search_icon"
|
||||||
tools:ignore="RtlSymmetry" />
|
tools:ignore="RtlSymmetry" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
Loading…
Reference in a new issue