mirror of
https://github.com/mihonapp/mihon.git
synced 2025-01-28 10:54:57 +01:00
catch exception & fix notification intent
This commit is contained in:
parent
5d95c72e03
commit
dd29305979
@ -629,7 +629,12 @@ class NotificationReceiver : BroadcastReceiver() {
|
||||
action = Constants.SHORTCUT_LIBRARY_UPDATE_ERRORS
|
||||
flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
|
||||
}
|
||||
return PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)
|
||||
return PendingIntent.getActivity(
|
||||
context,
|
||||
0,
|
||||
intent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE,
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,20 +1,42 @@
|
||||
package tachiyomi.domain.libraryUpdateError.interactor
|
||||
|
||||
import logcat.LogPriority
|
||||
import tachiyomi.core.common.util.lang.withNonCancellableContext
|
||||
import tachiyomi.core.common.util.system.logcat
|
||||
import tachiyomi.domain.libraryUpdateError.interactor.DeleteLibraryUpdateErrors.Result
|
||||
import tachiyomi.domain.libraryUpdateError.model.LibraryUpdateError
|
||||
import tachiyomi.domain.libraryUpdateError.repository.LibraryUpdateErrorRepository
|
||||
|
||||
class InsertLibraryUpdateErrors(
|
||||
private val libraryUpdateErrorRepository: LibraryUpdateErrorRepository,
|
||||
) {
|
||||
suspend fun upsert(libraryUpdateError: LibraryUpdateError) {
|
||||
return libraryUpdateErrorRepository.upsert(libraryUpdateError)
|
||||
suspend fun upsert(libraryUpdateError: LibraryUpdateError) = withNonCancellableContext {
|
||||
try {
|
||||
libraryUpdateErrorRepository.upsert(libraryUpdateError)
|
||||
Result.Success
|
||||
} catch (e: Exception) {
|
||||
logcat(LogPriority.ERROR, e)
|
||||
return@withNonCancellableContext Result.InternalError(e)
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun insert(libraryUpdateError: LibraryUpdateError) {
|
||||
return libraryUpdateErrorRepository.insert(libraryUpdateError)
|
||||
suspend fun insert(libraryUpdateError: LibraryUpdateError) = withNonCancellableContext {
|
||||
try {
|
||||
libraryUpdateErrorRepository.insert(libraryUpdateError)
|
||||
Result.Success
|
||||
} catch (e: Exception) {
|
||||
logcat(LogPriority.ERROR, e)
|
||||
return@withNonCancellableContext Result.InternalError(e)
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun insertAll(libraryUpdateErrors: List<LibraryUpdateError>) {
|
||||
return libraryUpdateErrorRepository.insertAll(libraryUpdateErrors)
|
||||
suspend fun insertAll(libraryUpdateErrors: List<LibraryUpdateError>) = withNonCancellableContext {
|
||||
try {
|
||||
libraryUpdateErrorRepository.insertAll(libraryUpdateErrors)
|
||||
Result.Success
|
||||
} catch (e: Exception) {
|
||||
logcat(LogPriority.ERROR, e)
|
||||
return@withNonCancellableContext Result.InternalError(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user