Skip to content

Commit

Permalink
Merge branch 'master' into merge-keiyoushi
Browse files Browse the repository at this point in the history
  • Loading branch information
cuong-tran committed Dec 1, 2024
2 parents ee6a201 + c4cc715 commit f00e184
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 32 deletions.
2 changes: 1 addition & 1 deletion lib-multisrc/kemono/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ plugins {
id("lib-multisrc")
}

baseVersionCode = 14
baseVersionCode = 15
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ open class Kemono(
GET("$baseUrl/$apiPath${chapter.url}", headers)

override fun pageListParse(response: Response): List<Page> {
val post: KemonoPostDto = response.parseAs()
return post.images.mapIndexed { i, path -> Page(i, imageUrl = baseUrl + path) }
val postData: KemonoPostDtoWrapped = response.parseAs()
return postData.post.images.mapIndexed { i, path -> Page(i, imageUrl = baseUrl + path) }
}

override fun imageRequest(page: Page): Request {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ class KemonoCreatorDto(
}
}

@Serializable
class KemonoPostDtoWrapped(
val post: KemonoPostDto,
)

@Serializable
class KemonoPostDto(
private val id: String,
Expand Down
2 changes: 1 addition & 1 deletion src/all/batoto/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Bato.to'
extClass = '.BatoToFactory'
extVersionCode = 41
extVersionCode = 42
isNsfw = true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ open class BatoTo(
return super.mangaDetailsRequest(manga)
}
private var titleRegex: Regex =
Regex("(?:\\([^()]*\\)|\\{[^{}]*\\}|\\[(?:(?!]).)*]|«[^»]*»|〘[^〙]*〙|「[^」]*」|『[^』]*』|≪[^≫]*≫|﹛[^﹜]*﹜|〖[^〖〗]*〗|𖤍.+?𖤍|《[^》]*》|/.+?|⌜.+?⌝)\\s*")
Regex("(?:\\([^()]*\\)|\\{[^{}]*\\}|\\[(?:(?!]).)*]|«[^»]*»|〘[^〙]*〙|「[^」]*」|『[^』]*』|≪[^≫]*≫|﹛[^﹜]*﹜|〖[^〖〗]*〗|𖤍.+?𖤍|《[^》]*》|.+?⌝|⟨[^⟩]*⟩|/.+)")

override fun mangaDetailsParse(document: Document): SManga {
val infoElement = document.select("div#mainer div.container-fluid")
Expand Down
2 changes: 1 addition & 1 deletion src/all/comickfun/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ext {
kmkVersionCode = 1
extName = 'Comick'
extClass = '.ComickFactory'
extVersionCode = 49
extVersionCode = 50
isNsfw = true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,17 +399,16 @@ abstract class Comick(
val coversUrl =
"$apiUrl/comic/${mangaData.comic.slug ?: mangaData.comic.hid}/covers?tachiyomi=true"
val covers = client.newCall(GET(coversUrl)).execute()
.parseAs<Covers>().mdCovers.reversed().toMutableList()
if (covers.any { it.vol == "1" }) covers.retainAll { it.vol == "1" }
if (
covers.any { it.locale == comickLang.split('-').first() }
) {
covers.retainAll { it.locale == comickLang.split('-').first() }
}
.parseAs<Covers>().mdCovers.reversed()
val firstVol = covers.filter { it.vol == "1" }.ifEmpty { covers }
val originalCovers = firstVol
.filter { mangaData.comic.isoLang.orEmpty().startsWith(it.locale.orEmpty()) }
val localCovers = firstVol
.filter { comickLang.startsWith(it.locale.orEmpty()) }
return mangaData.toSManga(
includeMuTags = preferences.includeMuTags,
scorePosition = preferences.scorePosition,
covers = covers,
covers = localCovers.ifEmpty { originalCovers }.ifEmpty { firstVol },
groupTags = preferences.groupTags,
)
}
Expand Down Expand Up @@ -491,9 +490,10 @@ abstract class Comick(
.map { it.toSChapter(mangaUrl) }
}

private val publishedDateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.ENGLISH).apply {
timeZone = TimeZone.getTimeZone("UTC")
}
private val publishedDateFormat =
SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.ENGLISH).apply {
timeZone = TimeZone.getTimeZone("UTC")
}

override fun getChapterUrl(chapter: SChapter): String {
return "$baseUrl${chapter.url}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class Comic(
@SerialName("md_comic_md_genres") val mdGenres: List<MdGenres>,
@SerialName("mu_comics") val muGenres: MuComicCategories = MuComicCategories(emptyList()),
@SerialName("bayesian_rating") val score: String? = null,
@SerialName("iso639_1") val isoLang: String? = null,
) {
val origination = when (country) {
"jp" -> Name("Manga")
Expand Down
2 changes: 1 addition & 1 deletion src/en/flamecomics/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Flame Comics'
extClass = '.FlameComics'
extVersionCode = 36
extVersionCode = 37
}

apply from: "$rootDir/common.gradle"
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,9 @@ class FlameComics : HttpSource() {
SManga.create().apply {
title = seriesData.title
setUrlWithoutDomain(
dataApiReqBuilder().apply {
val seriesID =
seriesData.series_id
baseUrl.toHttpUrl().newBuilder().apply {
addPathSegment("series")
addPathSegment("$seriesID.json")
addQueryParameter("id", seriesData.series_id.toString())
addPathSegment(seriesData.series_id.toString())
}.build().toString(),
)
thumbnail_url = imageApiUrlBuilder(
Expand Down Expand Up @@ -164,12 +161,11 @@ class FlameComics : HttpSource() {
)
}
}
var lastPage = page * 20
if (lastPage > manga.size) {
lastPage = manga.size
}
if (lastPage < 0) lastPage = 0
return MangasPage(manga.subList((page - 1) * 20, lastPage), lastPage < manga.size)

val itemsPerPage = 20
val startIndex = (page - 1) * itemsPerPage
val endIndex = minOf(page * itemsPerPage, manga.size)
return MangasPage(manga.subList(startIndex, endIndex), endIndex < manga.size)
}

override fun mangaDetailsRequest(manga: SManga): Request = GET(
Expand Down Expand Up @@ -199,6 +195,11 @@ class FlameComics : HttpSource() {
}.build().toString() + "&w=640&q=75",
)
description = seriesData.description

genre = seriesData.tags?.let { tags ->
(listOf(seriesData.type) + tags).joinToString()
} ?: seriesData.type

author = seriesData.author
status = when (seriesData.status.lowercase()) {
"ongoing" -> SManga.ONGOING
Expand All @@ -223,7 +224,7 @@ class FlameComics : HttpSource() {
chapter_number = chapter.chapter.toFloat()
date_upload = chapter.release_date * 1000
name = buildString {
append("Chapter ${chapter.chapter.toInt()} ")
append("Chapter ${chapter.chapter.toString().removeSuffix(".0")} ")
append(chapter.title ?: "")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ package eu.kanade.tachiyomi.extension.en.flamecomics

import kotlinx.serialization.KSerializer
import kotlinx.serialization.Serializable
import kotlinx.serialization.builtins.ListSerializer
import kotlinx.serialization.builtins.MapSerializer
import kotlinx.serialization.builtins.serializer
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
import kotlinx.serialization.json.Json

@Serializable
class NewBuildID(
Expand Down Expand Up @@ -70,6 +73,9 @@ class Series(
val altTitles: String?,
val description: String,
val cover: String,
val type: String,
@Serializable(with = TagsListSerializer::class)
val tags: List<String>?,
val author: String?,
val status: String,
val series_id: Int,
Expand Down Expand Up @@ -101,3 +107,14 @@ class KeysToListSerializer : KSerializer<List<Page>> {

override fun serialize(encoder: Encoder, value: List<Page>) {}
}

class TagsListSerializer : KSerializer<List<String>> {
private val listSer = ListSerializer(String.serializer())
override val descriptor: SerialDescriptor = listSer.descriptor
override fun deserialize(decoder: Decoder): List<String> {
val jsonString = decoder.decodeString()
return Json.decodeFromString(jsonString)
}

override fun serialize(encoder: Encoder, value: List<String>) {}
}
2 changes: 1 addition & 1 deletion src/en/mangago/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Mangago'
extClass = '.Mangago'
extVersionCode = 22
extVersionCode = 23
isNsfw = true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class Mangago : ParsedHttpSource(), ConfigurableSource {
override fun searchMangaNextPageSelector() = genreListingNextPageSelector

private var titleRegex: Regex =
Regex("(?:\\([^()]*\\)|\\{[^{}]*\\}|\\[(?:(?!]).)*]|«[^»]*»|〘[^〙]*〙|「[^」]*」|『[^』]*』|≪[^≫]*≫|﹛[^﹜]*﹜|〖[^〖〗]*〗|𖤍.+?𖤍|《[^》]*》|/.+?|⌜.+?⌝)\\s*")
Regex("(?:\\([^()]*\\)|\\{[^{}]*\\}|\\[(?:(?!]).)*]|«[^»]*»|〘[^〙]*〙|「[^」]*」|『[^』]*』|≪[^≫]*≫|﹛[^﹜]*﹜|〖[^〖〗]*〗|𖤍.+?𖤍|《[^》]*》|.+?⌝|⟨[^⟩]*⟩|/.+)")

override fun mangaDetailsParse(document: Document) = SManga.create().apply {
title = document.selectFirst(".w-title h1")!!.text()
Expand Down

0 comments on commit f00e184

Please sign in to comment.