diff --git a/src/en/earlymanga/build.gradle b/src/en/earlymanga/build.gradle index d2b854e0a..b3f3ae48f 100644 --- a/src/en/earlymanga/build.gradle +++ b/src/en/earlymanga/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'EarlyManga' extClass = '.EarlyManga' - extVersionCode = 22 + extVersionCode = 23 } apply from: "$rootDir/common.gradle" diff --git a/src/en/earlymanga/src/eu/kanade/tachiyomi/extension/en/earlymanga/EarlyManga.kt b/src/en/earlymanga/src/eu/kanade/tachiyomi/extension/en/earlymanga/EarlyManga.kt index 643e01f8b..47ef8603c 100644 --- a/src/en/earlymanga/src/eu/kanade/tachiyomi/extension/en/earlymanga/EarlyManga.kt +++ b/src/en/earlymanga/src/eu/kanade/tachiyomi/extension/en/earlymanga/EarlyManga.kt @@ -60,8 +60,10 @@ class EarlyManga : HttpSource() { override fun popularMangaParse(response: Response) = searchMangaParse(response) /* latest */ - override fun latestUpdatesRequest(page: Int) = - searchMangaRequest(page, "", OrderByFilter.LATEST) + override fun latestUpdatesRequest(page: Int): Request { + return GET("$apiUrl/home/show-more?page=$page") + } + override fun latestUpdatesParse(response: Response) = searchMangaParse(response) /* search */ @@ -93,7 +95,9 @@ class EarlyManga : HttpSource() { SManga.create().apply { url = "/manga/${it.id}/${it.slug}" title = it.title - thumbnail_url = "$baseUrl/storage/uploads/covers_optimized_mangalist/manga_${it.id}/${it.cover}" + thumbnail_url = it.cover?.let { cover -> + "$baseUrl/storage/uploads/covers_optimized_mangalist/manga_${it.id}/$cover" + } } }, hasNextPage = result.meta.last_page > result.meta.current_page, @@ -166,10 +170,17 @@ class EarlyManga : HttpSource() { title = result.title author = result.authors?.joinToString { it.trim() } artist = result.artists?.joinToString { it.trim() } - description = "${result.desc.trim()}\n\nAlternative Names: ${result.alt_titles?.joinToString { it.name.trim() }}" + description = buildString { + result.desc?.trim()?.also { append(it, "\n\n") } + result.alt_titles?.joinToString("\n") { "• ${it.name.trim()}" } + ?.takeUnless { it.isEmpty() } + ?.also { append("Alternative Names:\n", it) } + } genre = result.all_genres?.joinToString { it.name.trim() } status = result.pubstatus[0].name.parseStatus() - thumbnail_url = "$baseUrl/storage/uploads/covers/manga_${result.id}/${result.cover}" + thumbnail_url = result.cover?.let { cover -> + "$baseUrl/storage/uploads/covers/manga_${result.id}/$cover" + } } } @@ -211,9 +222,11 @@ class EarlyManga : HttpSource() { val chapterUrl = response.request.url.toString() .replace("/api", "") - return result.images.mapIndexed { index, img -> - Page(index = index, url = chapterUrl, imageUrl = "$cdnUrl/manga/manga_${result.manga_id}/chapter_${result.slug}/$img") - } + 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") + } } override fun imageRequest(page: Page): Request { diff --git a/src/en/earlymanga/src/eu/kanade/tachiyomi/extension/en/earlymanga/EarlyMangaDto.kt b/src/en/earlymanga/src/eu/kanade/tachiyomi/extension/en/earlymanga/EarlyMangaDto.kt index 3e797f94c..26b0ad8d0 100644 --- a/src/en/earlymanga/src/eu/kanade/tachiyomi/extension/en/earlymanga/EarlyMangaDto.kt +++ b/src/en/earlymanga/src/eu/kanade/tachiyomi/extension/en/earlymanga/EarlyMangaDto.kt @@ -13,7 +13,7 @@ data class SearchData( val id: Int, val title: String, val slug: String, - val cover: String, + val cover: String? = null, ) @Serializable @@ -31,8 +31,8 @@ data class MangaData( val artists: List?, val all_genres: List?, val pubstatus: List, - val desc: String = "Unknown", - val cover: String, + val desc: String? = "Unknown", + val cover: String? = null, ) @Serializable diff --git a/src/en/earlymanga/src/eu/kanade/tachiyomi/extension/en/earlymanga/EarlyMangaFilters.kt b/src/en/earlymanga/src/eu/kanade/tachiyomi/extension/en/earlymanga/EarlyMangaFilters.kt index af27a74aa..ff3f966c6 100644 --- a/src/en/earlymanga/src/eu/kanade/tachiyomi/extension/en/earlymanga/EarlyMangaFilters.kt +++ b/src/en/earlymanga/src/eu/kanade/tachiyomi/extension/en/earlymanga/EarlyMangaFilters.kt @@ -53,14 +53,11 @@ class OrderByFilter( private val options = listOf( "Views", "Bookmarks", - "Added date", - "Updated date", "Number of chapters", "Rating", ) val POPULAR = FilterList(OrderByFilter("Views")) - val LATEST = FilterList(OrderByFilter("Updated date")) } }