diff --git a/app/src/main/java/eu/kanade/domain/track/anime/interactor/TrackEpisode.kt b/app/src/main/java/eu/kanade/domain/track/anime/interactor/TrackEpisode.kt index cf67d18a4..86d854796 100644 --- a/app/src/main/java/eu/kanade/domain/track/anime/interactor/TrackEpisode.kt +++ b/app/src/main/java/eu/kanade/domain/track/anime/interactor/TrackEpisode.kt @@ -5,6 +5,7 @@ import eu.kanade.domain.track.anime.model.toDbTrack import eu.kanade.domain.track.anime.service.DelayedAnimeTrackingUpdateJob import eu.kanade.domain.track.anime.store.DelayedAnimeTrackingStore import eu.kanade.tachiyomi.data.track.TrackManager +import eu.kanade.tachiyomi.util.system.isOnline import kotlinx.coroutines.async import kotlinx.coroutines.awaitAll import kotlinx.coroutines.coroutineScope @@ -34,13 +35,12 @@ class TrackEpisode( async { runCatching { - try { + if (context.isOnline()) { service.animeService.update(updatedTrack.toDbTrack(), true) insertTrack.await(updatedTrack) - } catch (e: Exception) { + } else { delayedTrackingStore.addAnimeItem(updatedTrack) DelayedAnimeTrackingUpdateJob.setupTask(context) - throw e } } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerViewModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerViewModel.kt index 437d14bd1..6b6d03d8a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerViewModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerViewModel.kt @@ -573,11 +573,10 @@ class PlayerViewModel @JvmOverloads constructor( } private fun updateTrackEpisodeSeen(episode: Episode) { - if (basePreferences.incognitoMode().get()) return + if (basePreferences.incognitoMode().get() || !hasTrackers) return if (!trackPreferences.autoUpdateTrack().get()) return val anime = currentAnime ?: return - val context = Injekt.get() viewModelScope.launchNonCancellable {