Show captcha notfication for images

This commit is contained in:
Koitharu
2023-07-30 17:44:24 +03:00
parent 50554c6936
commit cd4317dec5
4 changed files with 19 additions and 17 deletions

View File

@@ -69,7 +69,6 @@ class TrackWorker @AssistedInject constructor(
private val settings: AppSettings,
private val tracker: Tracker,
@TrackerLogger private val logger: FileLogger,
private val captchaNotifier: CaptchaNotifier,
) : CoroutineWorker(context, workerParams) {
private val notificationManager by lazy { NotificationManagerCompat.from(applicationContext) }
@@ -130,7 +129,7 @@ class TrackWorker @AssistedInject constructor(
tracker.fetchUpdates(track, commit = true)
}.onFailure { e ->
if (e is CloudFlareProtectedException) {
captchaNotifier.notify(e)
CaptchaNotifier(applicationContext).notify(e)
}
logger.log("checkUpdatesAsync", e)
}.onSuccess { updates ->