Re-enable fetching chapters list for entries with licenced status (#1230)
Enable Licensed (cherry picked from commit 9cc7d42dd9676319559eddc7a4a264fca155e1ca)
This commit is contained in:
committed by
Jobobby04
parent
a40c54e60c
commit
4d8b5fc8a1
@@ -280,28 +280,19 @@ abstract class HttpSource : CatalogueSource {
|
||||
*
|
||||
* @param manga the manga to update.
|
||||
* @return the chapters for the manga.
|
||||
* @throws LicensedMangaChaptersException if a manga is licensed and therefore no chapters are available.
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
override suspend fun getChapterList(manga: SManga): List<SChapter> {
|
||||
if (manga.status == SManga.LICENSED) {
|
||||
throw LicensedMangaChaptersException()
|
||||
}
|
||||
|
||||
return fetchChapterList(manga).awaitSingle()
|
||||
}
|
||||
|
||||
@Deprecated("Use the non-RxJava API instead", replaceWith = ReplaceWith("getChapterList"))
|
||||
override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> {
|
||||
return if (manga.status != SManga.LICENSED) {
|
||||
client.newCall(chapterListRequest(manga))
|
||||
.asObservableSuccess()
|
||||
.map { response ->
|
||||
chapterListParse(response)
|
||||
}
|
||||
} else {
|
||||
Observable.error(LicensedMangaChaptersException())
|
||||
}
|
||||
return client.newCall(chapterListRequest(manga))
|
||||
.asObservableSuccess()
|
||||
.map { response ->
|
||||
chapterListParse(response)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -514,5 +505,3 @@ abstract class HttpSource : CatalogueSource {
|
||||
}
|
||||
// EXH <--
|
||||
}
|
||||
|
||||
class LicensedMangaChaptersException : RuntimeException()
|
||||
|
||||
Reference in New Issue
Block a user