[RU]Mangalib & Hentailib parse MyList authorization (#10426)
This commit is contained in:
parent
1e3332d805
commit
2f84d135c3
|
@ -6,7 +6,7 @@ ext {
|
||||||
extName = 'HentaiLib'
|
extName = 'HentaiLib'
|
||||||
pkgNameSuffix = 'ru.libhentai'
|
pkgNameSuffix = 'ru.libhentai'
|
||||||
extClass = '.LibHentai'
|
extClass = '.LibHentai'
|
||||||
extVersionCode = 1
|
extVersionCode = 2
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -492,6 +492,11 @@ class LibHentai : ConfigurableSource, HttpSource() {
|
||||||
url.addQueryParameter(if (tag.isIncluded()) "tags[include][]" else "tags[exclude][]", tag.id)
|
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())
|
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 StatusTitleList(titles: List<CheckFilter>) : Filter.Group<CheckFilter>("Статус тайтла", titles)
|
||||||
private class GenreList(genres: List<SearchFilter>) : Filter.Group<SearchFilter>("Жанры", genres)
|
private class GenreList(genres: List<SearchFilter>) : Filter.Group<SearchFilter>("Жанры", genres)
|
||||||
private class TagList(tags: List<SearchFilter>) : Filter.Group<SearchFilter>("Теги", tags)
|
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(
|
override fun getFilterList() = FilterList(
|
||||||
OrderBy(),
|
OrderBy(),
|
||||||
|
@ -550,7 +555,8 @@ class LibHentai : ConfigurableSource, HttpSource() {
|
||||||
GenreList(getGenreList()),
|
GenreList(getGenreList()),
|
||||||
TagList(getTagList()),
|
TagList(getTagList()),
|
||||||
StatusList(getStatusList()),
|
StatusList(getStatusList()),
|
||||||
StatusTitleList(getStatusTitleList())
|
StatusTitleList(getStatusTitleList()),
|
||||||
|
MyList(getMyList())
|
||||||
)
|
)
|
||||||
|
|
||||||
private class OrderBy : Filter.Sort(
|
private class OrderBy : Filter.Sort(
|
||||||
|
@ -823,6 +829,13 @@ class LibHentai : ConfigurableSource, HttpSource() {
|
||||||
SearchFilter("Яндэрэ", "146")
|
SearchFilter("Яндэрэ", "146")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
private fun getMyList() = listOf(
|
||||||
|
SearchFilter("Читаю", "1"),
|
||||||
|
SearchFilter("В планах", "2"),
|
||||||
|
SearchFilter("Брошено", "3"),
|
||||||
|
SearchFilter("Прочитано", "4"),
|
||||||
|
SearchFilter("Любимые", "5")
|
||||||
|
)
|
||||||
companion object {
|
companion object {
|
||||||
const val PREFIX_SLUG_SEARCH = "slug:"
|
const val PREFIX_SLUG_SEARCH = "slug:"
|
||||||
private const val SERVER_PREF = "MangaLibImageServer"
|
private const val SERVER_PREF = "MangaLibImageServer"
|
||||||
|
|
|
@ -6,7 +6,7 @@ ext {
|
||||||
extName = 'MangaLib'
|
extName = 'MangaLib'
|
||||||
pkgNameSuffix = 'ru.libmanga'
|
pkgNameSuffix = 'ru.libmanga'
|
||||||
extClass = '.LibManga'
|
extClass = '.LibManga'
|
||||||
extVersionCode = 58
|
extVersionCode = 59
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
|
@ -500,6 +500,11 @@ class LibManga : ConfigurableSource, HttpSource() {
|
||||||
url.addQueryParameter(if (tag.isIncluded()) "tags[include][]" else "tags[exclude][]", tag.id)
|
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())
|
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 GenreList(genres: List<SearchFilter>) : Filter.Group<SearchFilter>("Жанры", genres)
|
||||||
private class TagList(tags: List<SearchFilter>) : Filter.Group<SearchFilter>("Теги", tags)
|
private class TagList(tags: List<SearchFilter>) : Filter.Group<SearchFilter>("Теги", tags)
|
||||||
private class AgeList(ages: List<CheckFilter>) : Filter.Group<CheckFilter>("Возрастное ограничение", ages)
|
private class AgeList(ages: List<CheckFilter>) : Filter.Group<CheckFilter>("Возрастное ограничение", ages)
|
||||||
|
private class MyList(favorites: List<SearchFilter>) : Filter.Group<SearchFilter>("Мои списки", favorites)
|
||||||
|
|
||||||
override fun getFilterList() = FilterList(
|
override fun getFilterList() = FilterList(
|
||||||
OrderBy(),
|
OrderBy(),
|
||||||
|
@ -559,7 +565,8 @@ class LibManga : ConfigurableSource, HttpSource() {
|
||||||
TagList(getTagList()),
|
TagList(getTagList()),
|
||||||
StatusList(getStatusList()),
|
StatusList(getStatusList()),
|
||||||
StatusTitleList(getStatusTitleList()),
|
StatusTitleList(getStatusTitleList()),
|
||||||
AgeList(getAgeList())
|
AgeList(getAgeList()),
|
||||||
|
MyList(getMyList())
|
||||||
)
|
)
|
||||||
|
|
||||||
private class OrderBy : Filter.Sort(
|
private class OrderBy : Filter.Sort(
|
||||||
|
@ -770,6 +777,13 @@ class LibManga : ConfigurableSource, HttpSource() {
|
||||||
CheckFilter("18+", "2")
|
CheckFilter("18+", "2")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
private fun getMyList() = listOf(
|
||||||
|
SearchFilter("Читаю", "1"),
|
||||||
|
SearchFilter("В планах", "2"),
|
||||||
|
SearchFilter("Брошено", "3"),
|
||||||
|
SearchFilter("Прочитано", "4"),
|
||||||
|
SearchFilter("Любимые", "5")
|
||||||
|
)
|
||||||
companion object {
|
companion object {
|
||||||
const val PREFIX_SLUG_SEARCH = "slug:"
|
const val PREFIX_SLUG_SEARCH = "slug:"
|
||||||
private const val SERVER_PREF = "MangaLibImageServer"
|
private const val SERVER_PREF = "MangaLibImageServer"
|
||||||
|
|
Loading…
Reference in New Issue