Re-enable fetching chapters list for entries with licenced status (#1230)

Enable Licensed

(cherry picked from commit 9cc7d42dd9676319559eddc7a4a264fca155e1ca)
This commit is contained in:
Roshan Varughese
2024-09-17 20:47:04 +12:00
committed by Jobobby04
parent a40c54e60c
commit 4d8b5fc8a1
3 changed files with 5 additions and 19 deletions
@@ -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()