mirror of
https://github.com/null2264/yokai.git
synced 2025-06-20 18:24:42 +00:00
feat: Re-enable fetching chapters list for entries with licenced
This commit is contained in:
parent
353a002eb5
commit
0d8276040f
1 changed files with 5 additions and 16 deletions
|
@ -251,28 +251,19 @@ abstract class HttpSource : CatalogueSource {
|
||||||
*
|
*
|
||||||
* @param manga the manga to update.
|
* @param manga the manga to update.
|
||||||
* @return the chapters for the manga.
|
* @return the chapters for the manga.
|
||||||
* @throws LicensedMangaChaptersException if a manga is licensed and therefore no chapters are available.
|
|
||||||
*/
|
*/
|
||||||
@Suppress("DEPRECATION")
|
@Suppress("DEPRECATION")
|
||||||
override suspend fun getChapterList(manga: SManga): List<SChapter> {
|
override suspend fun getChapterList(manga: SManga): List<SChapter> {
|
||||||
if (manga.status == SManga.LICENSED) {
|
|
||||||
throw LicensedMangaChaptersException()
|
|
||||||
}
|
|
||||||
|
|
||||||
return fetchChapterList(manga).awaitSingle()
|
return fetchChapterList(manga).awaitSingle()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated("Use the non-RxJava API instead", replaceWith = ReplaceWith("getChapterList"))
|
@Deprecated("Use the non-RxJava API instead", replaceWith = ReplaceWith("getChapterList"))
|
||||||
override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> {
|
override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> {
|
||||||
return if (manga.status != SManga.LICENSED) {
|
return client.newCall(chapterListRequest(manga))
|
||||||
client.newCall(chapterListRequest(manga))
|
.asObservableSuccess()
|
||||||
.asObservableSuccess()
|
.map { response ->
|
||||||
.map { response ->
|
chapterListParse(response)
|
||||||
chapterListParse(response)
|
}
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Observable.error(LicensedMangaChaptersException())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -503,5 +494,3 @@ abstract class HttpSource : CatalogueSource {
|
||||||
*/
|
*/
|
||||||
override fun getFilterList() = FilterList()
|
override fun getFilterList() = FilterList()
|
||||||
}
|
}
|
||||||
|
|
||||||
class LicensedMangaChaptersException : Exception("Licensed - No chapters to show")
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue