diff --git a/src/ru/mangabook/build.gradle b/src/ru/mangabook/build.gradle index 09de9b19a..9cc79cee1 100644 --- a/src/ru/mangabook/build.gradle +++ b/src/ru/mangabook/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'MangaBook' pkgNameSuffix = 'ru.mangabook' extClass = '.MangaBook' - extVersionCode = 2 + extVersionCode = 3 libVersion = '1.2' } diff --git a/src/ru/mangabook/src/eu/kanade/tachiyomi/extension/ru/mangabook/MangaBook.kt b/src/ru/mangabook/src/eu/kanade/tachiyomi/extension/ru/mangabook/MangaBook.kt index 9e2ec6282..82afb54f1 100644 --- a/src/ru/mangabook/src/eu/kanade/tachiyomi/extension/ru/mangabook/MangaBook.kt +++ b/src/ru/mangabook/src/eu/kanade/tachiyomi/extension/ru/mangabook/MangaBook.kt @@ -41,7 +41,7 @@ class MangaBook : ParsedHttpSource() { return SManga.create().apply { element.select(".sh-desc a").first().let { setUrlWithoutDomain(it.attr("href")) - title = it.select("div.sh-title").text().split(" / ").last() + title = it.select("div.sh-title").text().split(" / ").sorted().first() } thumbnail_url = element.select(".short-poster.img-box > img").attr("src") } @@ -93,7 +93,7 @@ class MangaBook : ParsedHttpSource() { return SManga.create().apply { element.select(".flist.row a").first().let { setUrlWithoutDomain(it.attr("href")) - title = it.select("h4").text().split(" / ").last() + title = it.select("h4 strong").text().split(" / ").sorted().first() } thumbnail_url = element.select(".sposter img.img-responsive").attr("src") } @@ -114,7 +114,8 @@ class MangaBook : ParsedHttpSource() { override fun mangaDetailsParse(document: Document): SManga { val infoElement = document.select("article.full .fmid").first() val manga = SManga.create() - manga.title = document.select(".fheader h1").text().split(" / ").last() + val titlestr = document.select(".fheader h1").text().split(" / ").sorted() + manga.title = titlestr.first() manga.thumbnail_url = infoElement.select("img.img-responsive").first().attr("src") manga.author = infoElement.select(".vis:contains(Автор) > a").text() manga.artist = infoElement.select(".vis:contains(Художник) > a").text() @@ -134,7 +135,22 @@ class MangaBook : ParsedHttpSource() { else -> "Манхва" } manga.genre = infoElement.select(".vis:contains(Категории) > a").map { it.text() }.plusElement(category).joinToString { it.trim() } - manga.description = infoElement.select(".fdesc.slice-this").text() + val ratingValue = infoElement.select(".rating").text().substringAfter("Рейтинг ").substringBefore("/").toFloat() * 2 + val ratingVotes = infoElement.select(".rating").text().substringAfter("голосов: ").substringBefore(" ") + val ratingStar = when { + ratingValue > 9.5 -> "★★★★★" + ratingValue > 8.5 -> "★★★★✬" + ratingValue > 7.5 -> "★★★★☆" + ratingValue > 6.5 -> "★★★✬☆" + ratingValue > 5.5 -> "★★★☆☆" + ratingValue > 4.5 -> "★★✬☆☆" + ratingValue > 3.5 -> "★★☆☆☆" + ratingValue > 2.5 -> "★✬☆☆☆" + ratingValue > 1.5 -> "★☆☆☆☆" + ratingValue > 0.5 -> "✬☆☆☆☆" + else -> "☆☆☆☆☆" + } + manga.description = titlestr.last() + "\n" + ratingStar + " " + ratingValue + " (голосов: " + ratingVotes + ")\n" + infoElement.select(".fdesc.slice-this").text() return manga }