diff --git a/src/all/emerald/build.gradle b/src/all/emerald/build.gradle index 869023515..511c7bf07 100644 --- a/src/all/emerald/build.gradle +++ b/src/all/emerald/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Emerald' pkgNameSuffix = 'all.emerald' extClass = '.EmeraldFactory' - extVersionCode = 6 + extVersionCode = 7 libVersion = '1.2' } diff --git a/src/all/emerald/src/eu/kanade/tachiyomi/extension/all/emerald/Emerald.kt b/src/all/emerald/src/eu/kanade/tachiyomi/extension/all/emerald/Emerald.kt index 581b1f7a4..6a05e4d21 100644 --- a/src/all/emerald/src/eu/kanade/tachiyomi/extension/all/emerald/Emerald.kt +++ b/src/all/emerald/src/eu/kanade/tachiyomi/extension/all/emerald/Emerald.kt @@ -7,10 +7,12 @@ import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SManga +import eu.kanade.tachiyomi.source.model.MangasPage import eu.kanade.tachiyomi.source.online.ParsedHttpSource import okhttp3.HttpUrl import okhttp3.OkHttpClient import okhttp3.Request +import okhttp3.Response import org.json.JSONArray import org.json.JSONObject import org.jsoup.nodes.Document @@ -153,6 +155,15 @@ open class Emerald( override fun searchMangaNextPageSelector() = latestUpdatesNextPageSelector() + private val searchMangaTitles = HashSet() + + override fun searchMangaParse(response: Response): MangasPage { + val mp = super.searchMangaParse(response) + val manga = mp.mangas.distinctBy { it.title.toLowerCase() }.filterNot { searchMangaTitles.contains(it.title.toLowerCase()) } + searchMangaTitles.addAll(manga.map { it.title.toLowerCase() }) + return MangasPage(manga, mp.hasNextPage) + } + override fun mangaDetailsRequest(manga: SManga): Request { if (manga.url.startsWith("http")) { return GET(manga.url, headers)