diff --git a/src/ru/newbie/build.gradle b/src/ru/newbie/build.gradle index 5523e8fcd..c9d468a35 100644 --- a/src/ru/newbie/build.gradle +++ b/src/ru/newbie/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'NewManga(Newbie)' pkgNameSuffix = 'ru.newbie' extClass = '.Newbie' - extVersionCode = 9 + extVersionCode = 10 } dependencies { diff --git a/src/ru/newbie/src/eu/kanade/tachiyomi/extension/ru/newbie/Newbie.kt b/src/ru/newbie/src/eu/kanade/tachiyomi/extension/ru/newbie/Newbie.kt index 1671ce688..05fa76bce 100644 --- a/src/ru/newbie/src/eu/kanade/tachiyomi/extension/ru/newbie/Newbie.kt +++ b/src/ru/newbie/src/eu/kanade/tachiyomi/extension/ru/newbie/Newbie.kt @@ -56,7 +56,7 @@ class Newbie : HttpSource() { private var branches = mutableMapOf>() override fun headersBuilder(): Headers.Builder = Headers.Builder() - .add("User-Agent", "Tachiyomi") + .add("User-Agent", "Tachiyomi " + System.getProperty("http.agent")) .add("Referer", baseUrl) private fun imageContentTypeIntercept(chain: Interceptor.Chain): Response { @@ -139,6 +139,7 @@ class Newbie : HttpSource() { val mutableExTag = mutableListOf() val mutableType = mutableListOf() val mutableStatus = mutableListOf() + val mutableTitleStatus = mutableListOf() val mutableAge = mutableListOf() var orderBy = "MATCH" var ascEnd = "DESC" @@ -171,6 +172,11 @@ class Newbie : HttpSource() { mutableStatus += '"' + status.id + '"' } } + is StatusTitleList -> filter.state.forEach { status -> + if (status.state) { + mutableTitleStatus += '"' + status.id + '"' + } + } is AgeList -> filter.state.forEach { age -> if (age.state) { mutableAge += '"' + age.id + '"' @@ -186,7 +192,7 @@ class Newbie : HttpSource() { return POST( "https://neo.newmanga.org/catalogue", - body = """{"query":"$query","sort":{"kind":"$orderBy","dir":"$ascEnd"},"filter":{"hidden_projects":[],"genres":{"excluded":$mutableExGenre,"included":$mutableGenre},"tags":{"excluded":$mutableExTag,"included":$mutableTag},"type":{"allowed":$mutableType},"translation_status":{"allowed":[]},"released_year":{"min":null,"max":null},"require_chapters":$requireChapters,"original_status":{"allowed":$mutableStatus},"adult":{"allowed":$mutableAge}},"pagination":{"page":$page,"size":$count}}""".toRequestBody("application/json; charset=utf-8".toMediaTypeOrNull()), + body = """{"query":"$query","sort":{"kind":"$orderBy","dir":"$ascEnd"},"filter":{"hidden_projects":[],"genres":{"excluded":$mutableExGenre,"included":$mutableGenre},"tags":{"excluded":$mutableExTag,"included":$mutableTag},"type":{"allowed":$mutableType},"translation_status":{"allowed":$mutableStatus},"released_year":{"min":null,"max":null},"require_chapters":$requireChapters,"original_status":{"allowed":$mutableTitleStatus},"adult":{"allowed":$mutableAge}},"pagination":{"page":$page,"size":$count}}""".toRequestBody("application/json; charset=utf-8".toMediaTypeOrNull()), headers = headers ) } @@ -240,7 +246,7 @@ class Newbie : HttpSource() { thumbnail_url = "$IMAGE_URL/${image.srcset.large}" author = o.author?.name artist = o.artist?.name - description = o.title.ru + "\n" + ratingStar + " " + ratingValue + "\n" + Jsoup.parse(o.description).text() + description = o.title.ru + "\n" + ratingStar + " " + ratingValue + " [♡" + hearts + "]\n" + Jsoup.parse(o.description).text() genre = parseType(type) + ", " + adult?.let { parseAge(it) } + ", " + genres.joinToString { it.title.ru.capitalize() } status = parseStatus(o.status) } @@ -375,7 +381,8 @@ class Newbie : HttpSource() { private class SearchFilter(name: String) : Filter.TriState(name) private class TypeList(types: List) : Filter.Group("Типы", types) - private class StatusList(statuses: List) : Filter.Group("Статус", statuses) + private class StatusList(statuses: List) : Filter.Group("Статус перевода", statuses) + private class StatusTitleList(titles: List) : Filter.Group("Статус оригинала", titles) private class GenreList(genres: List) : Filter.Group("Жанры", genres) private class TagsList(tags: List) : Filter.Group("Теги", tags) private class AgeList(ages: List) : Filter.Group("Возрастное ограничение", ages) @@ -386,6 +393,7 @@ class Newbie : HttpSource() { TagsList(getTagsList()), TypeList(getTypeList()), StatusList(getStatusList()), + StatusTitleList(getStatusTitleList()), AgeList(getAgeList()), RequireChapters() ) @@ -412,6 +420,12 @@ class Newbie : HttpSource() { ) private fun getStatusList() = listOf( + CheckFilter("Выпускается", "ON_GOING"), + CheckFilter("Заброшен", "ABANDONED"), + CheckFilter("Завершён", "COMPLETED"), + ) + + private fun getStatusTitleList() = listOf( CheckFilter("Выпускается", "ON_GOING"), CheckFilter("Приостановлен", "SUSPENDED"), CheckFilter("Завершён", "COMPLETED"), diff --git a/src/ru/newbie/src/eu/kanade/tachiyomi/extension/ru/newbie/dto/Dto.kt b/src/ru/newbie/src/eu/kanade/tachiyomi/extension/ru/newbie/dto/Dto.kt index 43ff6b286..2b9f43dca 100644 --- a/src/ru/newbie/src/eu/kanade/tachiyomi/extension/ru/newbie/dto/Dto.kt +++ b/src/ru/newbie/src/eu/kanade/tachiyomi/extension/ru/newbie/dto/Dto.kt @@ -1,6 +1,6 @@ import kotlinx.serialization.Serializable -//Catalog API +// Catalog API @Serializable data class PageWrapperDto( val items: List, @@ -13,7 +13,7 @@ data class LibraryDto( val image: ImgDto ) -//Manga Details +// Manga Details @Serializable data class MangaDetDto( val id: Long, @@ -26,6 +26,7 @@ data class MangaDetDto( val type: String, val status: String, val rating: Float, + val hearts: Long, val adult: String?, val branches: List, ) @@ -63,7 +64,7 @@ data class BranchesDto( val is_default: Boolean ) -//Chapters +// Chapters @Serializable data class SeriesWrapperDto( val items: T @@ -86,7 +87,7 @@ data class PageDto( val slices: Int? ) -//Search NEO in POST Request +// Search NEO in POST Request @Serializable data class SearchWrapperDto( val result: T,