mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-19 01:59:19 +01:00
Fix some crashes
This commit is contained in:
parent
a7faf445c4
commit
cb357b0a16
@ -66,6 +66,7 @@ class DownloadQueue(
|
|||||||
val pageStatusSubject = PublishSubject.create<Int>()
|
val pageStatusSubject = PublishSubject.create<Int>()
|
||||||
setPagesSubject(download.pages, pageStatusSubject)
|
setPagesSubject(download.pages, pageStatusSubject)
|
||||||
return@flatMap pageStatusSubject
|
return@flatMap pageStatusSubject
|
||||||
|
.onBackpressureBuffer()
|
||||||
.filter { it == Page.READY }
|
.filter { it == Page.READY }
|
||||||
.map { download }
|
.map { download }
|
||||||
|
|
||||||
|
@ -39,11 +39,11 @@ class LibraryMangaUrlFetcher(private val networkFetcher: DataFetcher<InputStream
|
|||||||
// Copy the file and rename to the original.
|
// Copy the file and rename to the original.
|
||||||
data.use { output.use { data.copyTo(output) } }
|
data.use { output.use { data.copyTo(output) } }
|
||||||
tmpFile.renameTo(file)
|
tmpFile.renameTo(file)
|
||||||
|
loadFromFile(callback)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
tmpFile.delete()
|
tmpFile.delete()
|
||||||
callback.onLoadFailed(e)
|
callback.onLoadFailed(e)
|
||||||
}
|
}
|
||||||
loadFromFile(callback)
|
|
||||||
} else {
|
} else {
|
||||||
callback.onLoadFailed(Exception("Null data"))
|
callback.onLoadFailed(Exception("Null data"))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user