Keep future chapters on Mangadex like Billibi and Comikey
This commit is contained in:
parent
b227f2a4a5
commit
4ea72f5342
@ -191,14 +191,14 @@ abstract class HttpSource : CatalogueSource {
|
|||||||
*
|
*
|
||||||
* @param page the page number to retrieve.
|
* @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.
|
* Parses the response from the site and returns a [MangasPage] object.
|
||||||
*
|
*
|
||||||
* @param response the response from the site.
|
* @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
|
* Returns an observable with the updated details for a manga. Normally it's not needed to
|
||||||
|
@ -7,6 +7,7 @@ import eu.kanade.tachiyomi.data.database.models.Track
|
|||||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||||
import eu.kanade.tachiyomi.data.track.TrackManager
|
import eu.kanade.tachiyomi.data.track.TrackManager
|
||||||
import eu.kanade.tachiyomi.data.track.mdlist.MdList
|
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.MangasPage
|
||||||
import eu.kanade.tachiyomi.source.model.Page
|
import eu.kanade.tachiyomi.source.model.Page
|
||||||
import eu.kanade.tachiyomi.source.model.SChapter
|
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) }
|
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> {
|
override fun fetchMangaDetails(manga: SManga): Observable<SManga> {
|
||||||
return mangaHandler.fetchMangaDetailsObservable(manga, id, preferences.mangaDexForceLatestCovers().get())
|
return mangaHandler.fetchMangaDetailsObservable(manga, id, preferences.mangaDexForceLatestCovers().get())
|
||||||
}
|
}
|
||||||
|
@ -165,14 +165,10 @@ class ApiMangaParser(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun chapterListParse(chapterListResponse: List<ChapterDataDto>, groupMap: Map<String, String>): List<ChapterInfo> {
|
fun chapterListParse(chapterListResponse: List<ChapterDataDto>, groupMap: Map<String, String>): List<ChapterInfo> {
|
||||||
val now = System.currentTimeMillis()
|
return chapterListResponse
|
||||||
|
|
||||||
return chapterListResponse.asSequence()
|
|
||||||
.map {
|
.map {
|
||||||
mapChapter(it, groupMap)
|
mapChapter(it, groupMap)
|
||||||
}.filter {
|
}
|
||||||
it.dateUpload <= now
|
|
||||||
}.toList()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun chapterParseForMangaId(chapterDto: ChapterDto): String? {
|
fun chapterParseForMangaId(chapterDto: ChapterDto): String? {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user