mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-21 12:17:12 +03:00
small Episode Tracker change
This commit is contained in:
parent
f6d430df6c
commit
b8cdb9d55e
2 changed files with 4 additions and 5 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<Application>()
|
||||
|
||||
viewModelScope.launchNonCancellable {
|
||||
|
|
Loading…
Reference in a new issue