Add more replacement suspend functions for source APIs

These are basically 1-to-1 replacements for the existing RxJava APIs.
This will make the initial migration off of RxJava simpler. We'll
revisit the actual call flows in followup versions of the API.
This commit is contained in:
arkon
2023-09-08 17:28:04 -04:00
parent 1668be8587
commit 26c5d761da
12 changed files with 137 additions and 128 deletions
@@ -27,7 +27,7 @@ interface Source {
/**
* Get the updated details for a manga.
*
* @since extensions-lib 1.4
* @since extensions-lib 1.5
* @param manga the manga to update.
* @return the updated manga.
*/
@@ -39,7 +39,7 @@ interface Source {
/**
* Get all the available chapters for a manga.
*
* @since extensions-lib 1.4
* @since extensions-lib 1.5
* @param manga the manga to update.
* @return the chapters for the manga.
*/
@@ -52,7 +52,7 @@ interface Source {
* Get the list of pages a chapter has. Pages should be returned
* in the expected order; the index is ignored.
*
* @since extensions-lib 1.4
* @since extensions-lib 1.5
* @param chapter the chapter.
* @return the pages for the chapter.
*/
@@ -61,41 +61,24 @@ interface Source {
return fetchPageList(chapter).awaitSingle()
}
/**
* Returns an observable with the updated details for a manga.
*
* @param manga the manga to update.
*/
@Deprecated(
"Use the non-RxJava API instead",
ReplaceWith("getMangaDetails"),
)
fun fetchMangaDetails(manga: SManga): Observable<SManga> = throw IllegalStateException(
"Not used",
)
fun fetchMangaDetails(manga: SManga): Observable<SManga> =
throw IllegalStateException("Not used")
/**
* Returns an observable with all the available chapters for a manga.
*
* @param manga the manga to update.
*/
@Deprecated(
"Use the non-RxJava API instead",
ReplaceWith("getChapterList"),
)
fun fetchChapterList(manga: SManga): Observable<List<SChapter>> = throw IllegalStateException(
"Not used",
)
fun fetchChapterList(manga: SManga): Observable<List<SChapter>> =
throw IllegalStateException("Not used")
/**
* Returns an observable with the list of pages a chapter has. Pages should be returned
* in the expected order; the index is ignored.
*
* @param chapter the chapter.
*/
@Deprecated(
"Use the non-RxJava API instead",
ReplaceWith("getPageList"),
)
fun fetchPageList(chapter: SChapter): Observable<List<Page>> = Observable.empty()
fun fetchPageList(chapter: SChapter): Observable<List<Page>> =
throw IllegalStateException("Not used")
}