mirror of
https://github.com/mihonapp/mihon.git
synced 2025-03-09 22:30:08 +01:00
Attempt to fix crash when migrating or removing entries from library (#1828)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
This commit is contained in:
parent
b702603965
commit
563bc02113
@ -38,6 +38,7 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co
|
|||||||
- Fix backup/restore of category related preferences ([@cuong-tran](https://github.com/cuong-tran)) ([#1726](https://github.com/mihonapp/mihon/pull/1726))
|
- Fix backup/restore of category related preferences ([@cuong-tran](https://github.com/cuong-tran)) ([#1726](https://github.com/mihonapp/mihon/pull/1726))
|
||||||
- Fix WebView sending app's package name in `X-Requested-With` header, which led to sources blocking access ([@AwkwardPeak7](https://github.com/AwkwardPeak7)) ([#1812](https://github.com/mihonapp/mihon/pull/1812))
|
- Fix WebView sending app's package name in `X-Requested-With` header, which led to sources blocking access ([@AwkwardPeak7](https://github.com/AwkwardPeak7)) ([#1812](https://github.com/mihonapp/mihon/pull/1812))
|
||||||
- Fix an issue where tracker reading progress is changed to a lower value ([@Animeboynz](https://github.com/Animeboynz)) ([#1795](https://github.com/mihonapp/mihon/pull/1795))
|
- Fix an issue where tracker reading progress is changed to a lower value ([@Animeboynz](https://github.com/Animeboynz)) ([#1795](https://github.com/mihonapp/mihon/pull/1795))
|
||||||
|
- Attempt to fix crash when migrating or removing entries from library ([@FlaminSarge](https://github.com/FlaminSarge)) ([#1828](https://github.com/mihonapp/mihon/pull/1828))
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
- Remove alphabetical category sort option
|
- Remove alphabetical category sort option
|
||||||
|
@ -284,7 +284,7 @@ internal class MigrateDialogScreenModel(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (replace) {
|
if (replace) {
|
||||||
updateManga.await(MangaUpdate(oldManga.id, favorite = false, dateAdded = 0))
|
updateManga.awaitUpdateFavorite(oldManga.id, favorite = false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update custom cover (recheck if custom cover exists)
|
// Update custom cover (recheck if custom cover exists)
|
||||||
|
@ -1,8 +1,14 @@
|
|||||||
package tachiyomi.domain.manga.interactor
|
package tachiyomi.domain.manga.interactor
|
||||||
|
|
||||||
|
import kotlinx.coroutines.delay
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
import kotlinx.coroutines.flow.catch
|
||||||
|
import kotlinx.coroutines.flow.retry
|
||||||
|
import logcat.LogPriority
|
||||||
|
import tachiyomi.core.common.util.system.logcat
|
||||||
import tachiyomi.domain.library.model.LibraryManga
|
import tachiyomi.domain.library.model.LibraryManga
|
||||||
import tachiyomi.domain.manga.repository.MangaRepository
|
import tachiyomi.domain.manga.repository.MangaRepository
|
||||||
|
import kotlin.time.Duration.Companion.seconds
|
||||||
|
|
||||||
class GetLibraryManga(
|
class GetLibraryManga(
|
||||||
private val mangaRepository: MangaRepository,
|
private val mangaRepository: MangaRepository,
|
||||||
@ -14,5 +20,15 @@ class GetLibraryManga(
|
|||||||
|
|
||||||
fun subscribe(): Flow<List<LibraryManga>> {
|
fun subscribe(): Flow<List<LibraryManga>> {
|
||||||
return mangaRepository.getLibraryMangaAsFlow()
|
return mangaRepository.getLibraryMangaAsFlow()
|
||||||
|
.retry {
|
||||||
|
if (it is NullPointerException) {
|
||||||
|
delay(0.5.seconds)
|
||||||
|
true
|
||||||
|
} else {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
}.catch {
|
||||||
|
this@GetLibraryManga.logcat(LogPriority.ERROR, it)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user