MangaPlus: use alternative api endpoint that contains all latest updates (#11122)

use non-banner api endpoint that hopefully contains all updates
This commit is contained in:
nicki 2025-10-19 02:15:45 -07:00 committed by Draff
parent 007d231fa7
commit 9c74df6069
Signed by: Draff
GPG Key ID: E8A89F3211677653
3 changed files with 16 additions and 21 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = 'MANGA Plus by SHUEISHA'
extClass = '.MangaPlusFactory'
extVersionCode = 55
extVersionCode = 56
}
apply from: "$rootDir/common.gradle"

View File

@ -128,8 +128,7 @@ class MangaPlus(
}
}
override fun latestUpdatesRequest(page: Int) =
GET("$API_URL/web/web_homeV4?lang=$internalLang&clang=$internalLang&format=json", headers)
override fun latestUpdatesRequest(page: Int) = GET("$API_URL/home_v4?lang=$internalLang&clang=$internalLang&format=json", headers)
override fun latestUpdatesParse(response: Response): MangasPage {
val result = response.asMangaPlusResponse()
@ -138,26 +137,16 @@ class MangaPlus(
result.error!!.langPopup(langCode)?.body ?: intl["unknown_error"]
}
directory = result.success.webHomeViewV4!!.groups
.flatMap(UpdatedTitleV2Group::titleGroups)
.flatMap(OriginalTitleGroup::titles)
.map(UpdatedTitle::title)
.filter { it.language == langCode }
.distinctBy(Title::titleId)
directory =
result.success.homeViewV3!!
.groups
.flatMap(UpdatedTitleV2Group::titleGroups)
.flatMap(OriginalTitleGroup::titles)
.map(UpdatedTitle::title)
.filter { it.language == langCode }
.distinctBy(Title::titleId)
titleCache.putAll(directory.associateBy(Title::titleId))
titleCache.putAll(
result.success.webHomeViewV4.rankedTitles
.flatMap(RankedTitle::titles)
.filter { it.language == langCode }
.associateBy(Title::titleId),
)
titleCache.putAll(
result.success.webHomeViewV4.featuredTitleLists
.flatMap(FeaturedTitleList::featuredTitles)
.filter { it.language == langCode }
.associateBy(Title::titleId),
)
return parseDirectory(1)
}

View File

@ -34,6 +34,7 @@ class SuccessResult(
val mangaViewer: MangaViewer? = null,
val allTitlesViewV2: AllTitlesViewV2? = null,
val webHomeViewV4: WebHomeViewV4? = null,
val homeViewV3: HomeViewV3? = null,
)
@Serializable
@ -62,6 +63,11 @@ class WebHomeViewV4(
val featuredTitleLists: List<FeaturedTitleList> = emptyList(),
)
@Serializable
class HomeViewV3(
val groups: List<UpdatedTitleV2Group> = emptyList(),
)
@Serializable
class FeaturedTitleList(
val featuredTitles: List<Title> = emptyList(),