Browse Source

Fix some crashes

inorichi 7 năm trước cách đây
mục cha
commit
cb357b0a16

+ 1 - 0
app/src/main/java/eu/kanade/tachiyomi/data/download/model/DownloadQueue.kt

@@ -66,6 +66,7 @@ class DownloadQueue(
                         val pageStatusSubject = PublishSubject.create<Int>()
                         setPagesSubject(download.pages, pageStatusSubject)
                         return@flatMap pageStatusSubject
+                                .onBackpressureBuffer()
                                 .filter { it == Page.READY }
                                 .map { download }
 

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/data/glide/LibraryMangaUrlFetcher.kt

@@ -39,11 +39,11 @@ class LibraryMangaUrlFetcher(private val networkFetcher: DataFetcher<InputStream
                             // Copy the file and rename to the original.
                             data.use { output.use { data.copyTo(output) } }
                             tmpFile.renameTo(file)
+                            loadFromFile(callback)
                         } catch (e: Exception) {
                             tmpFile.delete()
                             callback.onLoadFailed(e)
                         }
-                        loadFromFile(callback)
                     } else {
                         callback.onLoadFailed(Exception("Null data"))
                     }