From 8d78ebe12f63575a038ed994b75530ace4a3ee4b Mon Sep 17 00:00:00 2001 From: Draff Date: Sun, 18 Feb 2024 20:51:30 +0000 Subject: [PATCH] fix other fucky wucky --- src/all/mangaplus/build.gradle | 2 +- .../extension/all/mangaplus/MangaPlus.kt | 17 +++++++++++++---- .../extension/all/mangaplus/MangaPlusDto.kt | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/all/mangaplus/build.gradle b/src/all/mangaplus/build.gradle index 9b9001acd..8781fe046 100644 --- a/src/all/mangaplus/build.gradle +++ b/src/all/mangaplus/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'MANGA Plus by SHUEISHA' extClass = '.MangaPlusFactory' - extVersionCode = 50 + extVersionCode = 51 } apply from: "$rootDir/common.gradle" 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 2762971d2..9e69132ca 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 @@ -250,7 +250,7 @@ class MangaPlus( private fun mangaDetailsRequest(mangaUrl: String): Request { val titleId = mangaUrl.substringAfterLast("/") - return GET("$APP_API_URL/title_detailV3?title_id=$titleId&lang=eng&os=android&os_ver=30&app_ver=${preferences.appVersion}&secret=${preferences.accountSecret}&format=json", headers) + return GET("$APP_API_URL/title_detailV3?title_id=$titleId&lang=eng&os=android&os_ver=30&app_ver=${preferences.appVersion}&secret=${preferences.accountSecret}&format=json", newHeaders) } override fun mangaDetailsParse(response: Response): SManga { @@ -377,11 +377,12 @@ class MangaPlus( summary = preferences.appVersion?.ifBlank { "The current app version" } ?: "", key = "${VER_PREF_KEY}_$lang", ) + screen.addPreference(qualityPref) screen.addPreference(splitPref) } - private fun PreferenceScreen.addEditTextPreference( + private fun PreferenceScreen.addEditTextPreference( title: String, default: String, summary: String, @@ -499,7 +500,7 @@ class MangaPlus( private val SharedPreferences.splitImages: Boolean get() = getBoolean("${SPLIT_PREF_KEY}_$lang", SPLIT_PREF_DEFAULT_VALUE) - private val SharedPreferences.appVersion: String? + private val SharedPreferences.appVersion: String? get() = getString("${VER_PREF_KEY}_$lang", VER_PREF_DEFAULT_VALUE) private val SharedPreferences.accountSecret: String? @@ -527,6 +528,14 @@ private const val SPLIT_PREF_DEFAULT_VALUE = true private const val VER_PREF_KEY = "appVer" private const val VER_PREF_DEFAULT_VALUE = "" - private const val SECRET_PREF_KEY = "accountSecret" private const val SECRET_PREF_DEFAULT_VALUE = "" + + +private const val NOT_FOUND_SUBJECT = "Not Found" + +private const val TITLE_THUMBNAIL_PATH = "title_thumbnail_portrait_list" + +private val ID_SEARCH_PATTERN = "^id:(\\d+)$".toRegex() +private val CHAPTER_ID_SEARCH_PATTERN = "^chapter-id:(\\d+)$".toRegex() + diff --git a/src/all/mangaplus/src/eu/kanade/tachiyomi/extension/all/mangaplus/MangaPlusDto.kt b/src/all/mangaplus/src/eu/kanade/tachiyomi/extension/all/mangaplus/MangaPlusDto.kt index 798812762..df5cdddd6 100644 --- a/src/all/mangaplus/src/eu/kanade/tachiyomi/extension/all/mangaplus/MangaPlusDto.kt +++ b/src/all/mangaplus/src/eu/kanade/tachiyomi/extension/all/mangaplus/MangaPlusDto.kt @@ -120,7 +120,6 @@ class TitleDetailView( add("Simulrelease") } - // funne hack thing to make the first letter capital add(titleLabels.planType.substring(0, 1).uppercase() + titleLabels.planType.substring(1)) if (isOneShot) { @@ -340,3 +339,4 @@ class MangaPage( val height: Int, val encryptionKey: String? = null, ) +