From d9309d4b0850b0d1dd03fe4e3d28ce15a69dca33 Mon Sep 17 00:00:00 2001 From: Alessandro Jean Date: Sun, 14 Jun 2020 15:25:59 -0300 Subject: [PATCH] Minor fixes for MangaPlus extension (#3534) * Minor fixes for MangaPlus extension. * Change the id overriding to the factory. * Remove unnecessary id overriding. * Remove outdated comment. --- src/all/mangaplus/build.gradle | 2 +- .../kanade/tachiyomi/extension/all/mangaplus/MangaPlus.kt | 6 +++--- .../tachiyomi/extension/all/mangaplus/MangaPlusApi.kt | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/all/mangaplus/build.gradle b/src/all/mangaplus/build.gradle index 96a9dfcef..26a80f723 100644 --- a/src/all/mangaplus/build.gradle +++ b/src/all/mangaplus/build.gradle @@ -6,7 +6,7 @@ ext { appName = 'Tachiyomi: MANGA Plus by SHUEISHA' pkgNameSuffix = 'all.mangaplus' extClass = '.MangaPlusFactory' - extVersionCode = 8 + extVersionCode = 9 libVersion = '1.2' } diff --git a/src/all/mangaplus/src/eu/kanade/tachiyomi/extension/all/mangaplus/MangaPlus.kt b/src/all/mangaplus/src/eu/kanade/tachiyomi/extension/all/mangaplus/MangaPlus.kt index 8882a0670..d0accaacf 100644 --- a/src/all/mangaplus/src/eu/kanade/tachiyomi/extension/all/mangaplus/MangaPlus.kt +++ b/src/all/mangaplus/src/eu/kanade/tachiyomi/extension/all/mangaplus/MangaPlus.kt @@ -40,7 +40,7 @@ abstract class MangaPlus( private val langCode: Language ) : HttpSource(), ConfigurableSource { - override val name = "Manga Plus by Shueisha" + override val name = "MANGA Plus by SHUEISHA" override val baseUrl = "https://mangaplus.shueisha.co.jp" @@ -196,8 +196,8 @@ abstract class MangaPlus( val isCompleted = details.nonAppearanceInfo.contains(COMPLETE_REGEX) return SManga.create().apply { - author = title.author - artist = title.author + author = title.author.replace(" / ", ", ") + artist = author description = details.overview + "\n\n" + details.viewingPeriodDescription status = if (isCompleted) SManga.COMPLETED else SManga.ONGOING thumbnail_url = title.portraitImageUrl.toWeservUrl() diff --git a/src/all/mangaplus/src/eu/kanade/tachiyomi/extension/all/mangaplus/MangaPlusApi.kt b/src/all/mangaplus/src/eu/kanade/tachiyomi/extension/all/mangaplus/MangaPlusApi.kt index 1c7b499dd..dbe2f59e2 100644 --- a/src/all/mangaplus/src/eu/kanade/tachiyomi/extension/all/mangaplus/MangaPlusApi.kt +++ b/src/all/mangaplus/src/eu/kanade/tachiyomi/extension/all/mangaplus/MangaPlusApi.kt @@ -76,7 +76,7 @@ data class Title( @ProtoId(3) val author: String, @ProtoId(4) val portraitImageUrl: String, @ProtoId(5) val landscapeImageUrl: String, - @ProtoId(6) val viewCount: Int, + @ProtoId(6) val viewCount: Int = 0, @ProtoId(7) val language: Language? = Language.ENGLISH ) @@ -189,6 +189,7 @@ const val DECODE_SCRIPT: String = """ .add(new Field("nextTimeStamp", 5, "uint32")) .add(new Field("updateTiming", 6, "UpdateTiming")) .add(new Field("viewingPeriodDescription", 7, "string")) + .add(new Field("nonAppearanceInfo", 8, "string", {"default": ""})) .add(new Field("firstChapterList", 9, "Chapter", "repeated")) .add(new Field("lastChapterList", 10, "Chapter", "repeated")) .add(new Field("isSimulReleased", 14, "bool")) @@ -214,7 +215,7 @@ const val DECODE_SCRIPT: String = """ .add(new Field("author", 3, "string")) .add(new Field("portraitImageUrl", 4, "string")) .add(new Field("landscapeImageUrl", 5, "string")) - .add(new Field("viewCount", 6, "uint32")) + .add(new Field("viewCount", 6, "uint32", {"default": 0})) .add(new Field("language", 7, "Language", {"default": 0})); var Language = new Enum("Language")