diff --git a/src/ru/libhentai/build.gradle b/src/ru/libhentai/build.gradle index 78fa3a4e6..7469d3b1b 100644 --- a/src/ru/libhentai/build.gradle +++ b/src/ru/libhentai/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'HentaiLib' pkgNameSuffix = 'ru.libhentai' extClass = '.LibHentai' - extVersionCode = 1 + extVersionCode = 2 isNsfw = true } diff --git a/src/ru/libhentai/src/eu/kanade/tachiyomi/extension/ru/libhentai/LibHentai.kt b/src/ru/libhentai/src/eu/kanade/tachiyomi/extension/ru/libhentai/LibHentai.kt index 5c9ef8e0b..0c199dc55 100644 --- a/src/ru/libhentai/src/eu/kanade/tachiyomi/extension/ru/libhentai/LibHentai.kt +++ b/src/ru/libhentai/src/eu/kanade/tachiyomi/extension/ru/libhentai/LibHentai.kt @@ -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) : Filter.Group("Статус тайтла", titles) private class GenreList(genres: List) : Filter.Group("Жанры", genres) private class TagList(tags: List) : Filter.Group("Теги", tags) - private class AgeList(ages: List) : Filter.Group("Возрастное ограничение", ages) + private class MyList(favorites: List) : Filter.Group("Мои списки", 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" diff --git a/src/ru/libmanga/build.gradle b/src/ru/libmanga/build.gradle index cd31b84bd..24c412e05 100644 --- a/src/ru/libmanga/build.gradle +++ b/src/ru/libmanga/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'MangaLib' pkgNameSuffix = 'ru.libmanga' extClass = '.LibManga' - extVersionCode = 58 + extVersionCode = 59 } dependencies { diff --git a/src/ru/libmanga/src/eu/kanade/tachiyomi/extension/ru/libmanga/LibManga.kt b/src/ru/libmanga/src/eu/kanade/tachiyomi/extension/ru/libmanga/LibManga.kt index 17a4cc82c..ef5751a6e 100644 --- a/src/ru/libmanga/src/eu/kanade/tachiyomi/extension/ru/libmanga/LibManga.kt +++ b/src/ru/libmanga/src/eu/kanade/tachiyomi/extension/ru/libmanga/LibManga.kt @@ -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) : Filter.Group("Жанры", genres) private class TagList(tags: List) : Filter.Group("Теги", tags) private class AgeList(ages: List) : Filter.Group("Возрастное ограничение", ages) + private class MyList(favorites: List) : Filter.Group("Мои списки", 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"