Fix MangaTown endless search

This commit is contained in:
Koitharu
2020-07-05 17:04:24 +03:00
parent bf45480366
commit 66ca51cc73
3 changed files with 8 additions and 3 deletions

View File

@@ -23,7 +23,7 @@ abstract class ChanRepository(loaderContext: MangaLoaderContext) : RemoteMangaRe
): List<Manga> {
val domain = conf.getDomain(defaultDomain)
val url = when {
query != null -> {
!query.isNullOrEmpty() -> {
if (offset != 0) {
return emptyList()
}

View File

@@ -37,7 +37,12 @@ class MangaTownRepository(loaderContext: MangaLoaderContext) : RemoteMangaReposi
}
val page = (offset / 30) + 1
val url = when {
!query.isNullOrEmpty() -> "$scheme://$domain/search?name=${query.urlEncoded()}"
!query.isNullOrEmpty() -> {
if (offset != 0) {
return emptyList()
}
"$scheme://$domain/search?name=${query.urlEncoded()}"
}
tag != null -> "$scheme://$domain/directory/${tag.key}/$page.htm$sortKey"
else -> "$scheme://$domain/directory/$page.htm$sortKey"
}