mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-29 01:29:02 +03:00
fix marking previous episodes as read going in the
wrong direction
This commit is contained in:
parent
d117a81b4c
commit
91ee5c993c
1 changed files with 2 additions and 2 deletions
|
@ -708,7 +708,7 @@ class AnimeController :
|
|||
}
|
||||
if (data.getBooleanExtra("previousResult", false)) {
|
||||
val episodeList = presenter.filteredAndSortedEpisodes
|
||||
val idx = episodeList.indexOfFirst { it.episode_number == episode.episode_number }
|
||||
val idx = episodeList.indexOfLast { it.episode_number == episode.episode_number }
|
||||
val previousEpisode = episodeList[idx + 1].episode
|
||||
openEpisode(previousEpisode)
|
||||
}
|
||||
|
@ -1049,7 +1049,7 @@ class AnimeController :
|
|||
|
||||
private fun markPreviousAsRead(episodes: List<EpisodeItem>) {
|
||||
val adapter = episodesAdapter ?: return
|
||||
val prevEpisodes = if (presenter.sortDescending()) adapter.items.reversed() else adapter.items
|
||||
val prevEpisodes = if (presenter.sortDescending()) adapter.items else adapter.items.reversed()
|
||||
val episodePos = prevEpisodes.indexOf(episodes.lastOrNull())
|
||||
if (episodePos != -1) {
|
||||
markAsRead(prevEpisodes.take(episodePos))
|
||||
|
|
Loading…
Reference in a new issue