Keep future chapters on Mangadex like Billibi and Comikey

This commit is contained in:
Jobobby04 2021-11-14 18:34:22 -05:00
parent b227f2a4a5
commit 4ea72f5342
3 changed files with 17 additions and 9 deletions

View File

@ -191,14 +191,14 @@ abstract class HttpSource : CatalogueSource {
*
* @param page the page number to retrieve.
*/
protected abstract fun latestUpdatesRequest(page: Int): Request
/* SY --> protected <-- SY */ abstract fun latestUpdatesRequest(page: Int): Request
/**
* Parses the response from the site and returns a [MangasPage] object.
*
* @param response the response from the site.
*/
protected abstract fun latestUpdatesParse(response: Response): MangasPage
/* SY --> protected <-- SY */ abstract fun latestUpdatesParse(response: Response): MangasPage
/**
* Returns an observable with the updated details for a manga. Normally it's not needed to

View File

@ -7,6 +7,7 @@ import eu.kanade.tachiyomi.data.database.models.Track
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.data.track.TrackManager
import eu.kanade.tachiyomi.data.track.mdlist.MdList
import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
@ -153,7 +154,18 @@ class MangaDex(delegate: HttpSource, val context: Context) :
return mangaHandler.getMangaFromChapterId(id)?.let { MdUtil.buildMangaUrl(it) }
}
// HttpSource methods
override fun fetchLatestUpdates(page: Int): Observable<MangasPage> {
val request = delegate.latestUpdatesRequest(page)
val url = request.url.newBuilder()
.removeAllQueryParameters("includeFutureUpdates")
.build()
return client.newCall(request.newBuilder().url(url).build())
.asObservableSuccess()
.map { response ->
delegate.latestUpdatesParse(response)
}
}
override fun fetchMangaDetails(manga: SManga): Observable<SManga> {
return mangaHandler.fetchMangaDetailsObservable(manga, id, preferences.mangaDexForceLatestCovers().get())
}

View File

@ -165,14 +165,10 @@ class ApiMangaParser(
}
fun chapterListParse(chapterListResponse: List<ChapterDataDto>, groupMap: Map<String, String>): List<ChapterInfo> {
val now = System.currentTimeMillis()
return chapterListResponse.asSequence()
return chapterListResponse
.map {
mapChapter(it, groupMap)
}.filter {
it.dateUpload <= now
}.toList()
}
}
fun chapterParseForMangaId(chapterDto: ChapterDto): String? {