[RU]Mangalib & Hentailib parse MyList authorization (#10426)

This commit is contained in:
e-shl 2022-01-11 17:53:58 +05:00 committed by GitHub
parent 1e3332d805
commit 2f84d135c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 5 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'HentaiLib'
pkgNameSuffix = 'ru.libhentai'
extClass = '.LibHentai'
extVersionCode = 1
extVersionCode = 2
isNsfw = true
}

View File

@ -492,6 +492,11 @@ class LibHentai : ConfigurableSource, HttpSource() {
url.addQueryParameter(if (tag.isIncluded()) "tags[include][]" else "tags[exclude][]", tag.id)
}
}
is MyList -> filter.state.forEach { favorite ->
if (favorite.state != Filter.TriState.STATE_IGNORE) {
url.addQueryParameter(if (favorite.isIncluded()) "bookmarks[include][]" else "bookmarks[exclude][]", favorite.id)
}
}
}
}
return POST(url.toString(), catalogHeaders())
@ -541,7 +546,7 @@ class LibHentai : ConfigurableSource, HttpSource() {
private class StatusTitleList(titles: List<CheckFilter>) : Filter.Group<CheckFilter>("Статус тайтла", titles)
private class GenreList(genres: List<SearchFilter>) : Filter.Group<SearchFilter>("Жанры", genres)
private class TagList(tags: List<SearchFilter>) : Filter.Group<SearchFilter>("Теги", tags)
private class AgeList(ages: List<CheckFilter>) : Filter.Group<CheckFilter>("Возрастное ограничение", ages)
private class MyList(favorites: List<SearchFilter>) : Filter.Group<SearchFilter>("Мои списки", favorites)
override fun getFilterList() = FilterList(
OrderBy(),
@ -550,7 +555,8 @@ class LibHentai : ConfigurableSource, HttpSource() {
GenreList(getGenreList()),
TagList(getTagList()),
StatusList(getStatusList()),
StatusTitleList(getStatusTitleList())
StatusTitleList(getStatusTitleList()),
MyList(getMyList())
)
private class OrderBy : Filter.Sort(
@ -823,6 +829,13 @@ class LibHentai : ConfigurableSource, HttpSource() {
SearchFilter("Яндэрэ", "146")
)
private fun getMyList() = listOf(
SearchFilter("Читаю", "1"),
SearchFilter("В планах", "2"),
SearchFilter("Брошено", "3"),
SearchFilter("Прочитано", "4"),
SearchFilter("Любимые", "5")
)
companion object {
const val PREFIX_SLUG_SEARCH = "slug:"
private const val SERVER_PREF = "MangaLibImageServer"

View File

@ -6,7 +6,7 @@ ext {
extName = 'MangaLib'
pkgNameSuffix = 'ru.libmanga'
extClass = '.LibManga'
extVersionCode = 58
extVersionCode = 59
}
dependencies {

View File

@ -500,6 +500,11 @@ class LibManga : ConfigurableSource, HttpSource() {
url.addQueryParameter(if (tag.isIncluded()) "tags[include][]" else "tags[exclude][]", tag.id)
}
}
is MyList -> filter.state.forEach { favorite ->
if (favorite.state != Filter.TriState.STATE_IGNORE) {
url.addQueryParameter(if (favorite.isIncluded()) "bookmarks[include][]" else "bookmarks[exclude][]", favorite.id)
}
}
}
}
return POST(url.toString(), catalogHeaders())
@ -550,6 +555,7 @@ class LibManga : ConfigurableSource, HttpSource() {
private class GenreList(genres: List<SearchFilter>) : Filter.Group<SearchFilter>("Жанры", genres)
private class TagList(tags: List<SearchFilter>) : Filter.Group<SearchFilter>("Теги", tags)
private class AgeList(ages: List<CheckFilter>) : Filter.Group<CheckFilter>("Возрастное ограничение", ages)
private class MyList(favorites: List<SearchFilter>) : Filter.Group<SearchFilter>("Мои списки", favorites)
override fun getFilterList() = FilterList(
OrderBy(),
@ -559,7 +565,8 @@ class LibManga : ConfigurableSource, HttpSource() {
TagList(getTagList()),
StatusList(getStatusList()),
StatusTitleList(getStatusTitleList()),
AgeList(getAgeList())
AgeList(getAgeList()),
MyList(getMyList())
)
private class OrderBy : Filter.Sort(
@ -770,6 +777,13 @@ class LibManga : ConfigurableSource, HttpSource() {
CheckFilter("18+", "2")
)
private fun getMyList() = listOf(
SearchFilter("Читаю", "1"),
SearchFilter("В планах", "2"),
SearchFilter("Брошено", "3"),
SearchFilter("Прочитано", "4"),
SearchFilter("Любимые", "5")
)
companion object {
const val PREFIX_SLUG_SEARCH = "slug:"
private const val SERVER_PREF = "MangaLibImageServer"