mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-10 11:08:56 +01:00
delete error from DB when successfully updated
This commit is contained in:
@@ -29,6 +29,16 @@ class DeleteLibraryUpdateErrors(
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun deleteMangaError(mangaId: Long) = withNonCancellableContext {
|
||||
try {
|
||||
libraryUpdateErrorRepository.deleteMangaError(mangaId)
|
||||
Result.Success
|
||||
} catch (e: Exception) {
|
||||
logcat(LogPriority.ERROR, e)
|
||||
return@withNonCancellableContext Result.InternalError(e)
|
||||
}
|
||||
}
|
||||
|
||||
sealed class Result {
|
||||
object Success : Result()
|
||||
data class InternalError(val error: Throwable) : Result()
|
||||
|
||||
@@ -13,6 +13,8 @@ interface LibraryUpdateErrorRepository {
|
||||
|
||||
suspend fun delete(errorId: Long)
|
||||
|
||||
suspend fun deleteMangaError(mangaId: Long)
|
||||
|
||||
suspend fun upsert(libraryUpdateError: LibraryUpdateError)
|
||||
|
||||
suspend fun insert(libraryUpdateError: LibraryUpdateError)
|
||||
|
||||
Reference in New Issue
Block a user