Clean up ChapterCache (remove Gson, Rx usage)

This commit is contained in:
arkon
2021-04-18 11:03:55 -04:00
parent ad57fde1c5
commit 356b7c346a
3 changed files with 58 additions and 62 deletions
@@ -85,8 +85,7 @@ class HttpPageLoader(
* the local cache, otherwise fallbacks to network.
*/
override fun getPages(): Observable<List<ReaderPage>> {
return chapterCache
.getPageListFromCache(chapter.chapter)
return Observable.fromCallable { chapterCache.getPageListFromCache(chapter.chapter) }
.onErrorResumeNext { source.fetchPageList(chapter.chapter) }
.map { pages ->
pages.mapIndexed { index, page ->