Fix *chan search
This commit is contained in:
@@ -23,7 +23,12 @@ abstract class ChanRepository(loaderContext: MangaLoaderContext) : RemoteMangaRe
|
|||||||
): List<Manga> {
|
): List<Manga> {
|
||||||
val domain = conf.getDomain(defaultDomain)
|
val domain = conf.getDomain(defaultDomain)
|
||||||
val url = when {
|
val url = when {
|
||||||
query != null -> "https://$domain/?do=search&subaction=search&story=${query.urlEncoded()}"
|
query != null -> {
|
||||||
|
if (offset != 0) {
|
||||||
|
return emptyList()
|
||||||
|
}
|
||||||
|
"https://$domain/?do=search&subaction=search&story=${query.urlEncoded()}"
|
||||||
|
}
|
||||||
tag != null -> "https://$domain/tags/${tag.key}&n=${getSortKey2(sortOrder)}?offset=$offset"
|
tag != null -> "https://$domain/tags/${tag.key}&n=${getSortKey2(sortOrder)}?offset=$offset"
|
||||||
else -> "https://$domain/${getSortKey(sortOrder)}?offset=$offset"
|
else -> "https://$domain/${getSortKey(sortOrder)}?offset=$offset"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ abstract class MangaListFragment<E> : BaseFragment(R.layout.fragment_list),
|
|||||||
}
|
}
|
||||||
|
|
||||||
final override fun onRefresh() {
|
final override fun onRefresh() {
|
||||||
|
swipeRefreshLayout.isRefreshing = true
|
||||||
onRequestMoreItems(0)
|
onRequestMoreItems(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,10 +189,11 @@ abstract class MangaListFragment<E> : BaseFragment(R.layout.fragment_list),
|
|||||||
override fun onLoadingStateChanged(isLoading: Boolean) {
|
override fun onLoadingStateChanged(isLoading: Boolean) {
|
||||||
val hasItems = recyclerView.hasItems
|
val hasItems = recyclerView.hasItems
|
||||||
progressBar.isVisible = isLoading && !hasItems
|
progressBar.isVisible = isLoading && !hasItems
|
||||||
swipeRefreshLayout.isRefreshing = isLoading && hasItems
|
|
||||||
swipeRefreshLayout.isEnabled = isSwipeRefreshEnabled && !progressBar.isVisible
|
swipeRefreshLayout.isEnabled = isSwipeRefreshEnabled && !progressBar.isVisible
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
layout_holder.isVisible = false
|
layout_holder.isVisible = false
|
||||||
|
} else {
|
||||||
|
swipeRefreshLayout.isRefreshing = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user