Add specific support for dummy extensions so that read chapter history is able to be freely restored without connecting to the source

This commit is contained in:
Jobobby04 2020-05-08 21:18:29 -04:00
parent e4d40c7693
commit 88963758b1

View File

@ -303,7 +303,16 @@ class BackupManager(val context: Context, version: Int = CURRENT_VERSION) {
} else {
source.fetchChapterList(manga)
}
).map { syncChaptersWithSource(databaseHelper, it, manga, source) }
).map {
if (it.last().chapter_number == -99F) {
chapters.forEach { chapter ->
chapter.name = "Chapter ${chapter.chapter_number} restored by dummy source"
}
syncChaptersWithSource(databaseHelper, chapters, manga, source)
} else {
syncChaptersWithSource(databaseHelper, it, manga, source)
}
}
.doOnNext { pair ->
if (pair.first.isNotEmpty()) {
chapters.forEach { it.manga_id = manga.id }