fix episode being marked as seen when exiting...

...before the full episode length was loaded
This commit is contained in:
jmir1 2021-05-17 12:26:45 +02:00
parent ecaddb7255
commit 5559df14a5

View file

@ -639,12 +639,14 @@ class AnimeController :
presenter.editCover(anime!!, activity, dataUri)
}
if (requestCode == REQUEST_SECONDS) {
val seconds = data!!.getLongExtra("seconds_result", 0)
val totalSeconds = data.getLongExtra("total_seconds_result", 0)
val seconds = data!!.getLongExtra("seconds_result", 0L)
val totalSeconds = data.getLongExtra("total_seconds_result", 0L)
val episode: Episode = data.getSerializableExtra("episode") as Episode
episode.last_second_seen = seconds
episode.total_seconds = totalSeconds
presenter.setEpisodesProgress(arrayListOf(EpisodeItem(episode, anime!!)))
if (totalSeconds > 0L) {
episode.last_second_seen = seconds
episode.total_seconds = totalSeconds
presenter.setEpisodesProgress(arrayListOf(EpisodeItem(episode, anime!!)))
}
// if next or previous episode was pressed
if (data.getBooleanExtra("nextResult", false)) {
val episodeList = presenter.episodes.sortedWith(presenter.getEpisodeSort())