Earlym fix pages (#1105)
This commit is contained in:
parent
584e00b1dd
commit
b2ddfd348b
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'EarlyManga'
|
||||
extClass = '.EarlyManga'
|
||||
extVersionCode = 23
|
||||
extVersionCode = 24
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -25,14 +25,10 @@ class EarlyManga : HttpSource() {
|
|||
|
||||
override val name = "EarlyManga"
|
||||
|
||||
private val domain = "earlym.org"
|
||||
|
||||
override val baseUrl = "https://$domain"
|
||||
override val baseUrl = "https://earlym.org"
|
||||
|
||||
private val apiUrl = "$baseUrl/api"
|
||||
|
||||
private val cdnUrl = "https://images.$domain"
|
||||
|
||||
override val lang = "en"
|
||||
|
||||
override val supportsLatest = true
|
||||
|
@ -221,11 +217,15 @@ class EarlyManga : HttpSource() {
|
|||
val result = response.parseAs<PageListResponse>().chapter
|
||||
val chapterUrl = response.request.url.toString()
|
||||
.replace("/api", "")
|
||||
|
||||
val preSlug = if (result.on_disk != 0) {
|
||||
"storage/uploads/manga"
|
||||
} else {
|
||||
"e-storage/uploads/manga"
|
||||
}
|
||||
return result.images
|
||||
.filterNot { it.endsWith(".ico") }
|
||||
.mapIndexed { index, img ->
|
||||
Page(index = index, url = chapterUrl, imageUrl = "$cdnUrl/manga/manga_${result.manga_id}/chapter_${result.slug}/$img")
|
||||
Page(index = index, url = chapterUrl, imageUrl = "$baseUrl/$preSlug/manga_${result.manga_id}/chapter_${result.slug}/$img")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -59,6 +59,7 @@ data class Chapter(
|
|||
val id: Int,
|
||||
val manga_id: Int,
|
||||
val slug: String,
|
||||
val on_disk: Int,
|
||||
val images: List<String>,
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue