Skip to content

Commit

Permalink
fix episode sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
jmir1 committed Jun 14, 2021
1 parent 07550e1 commit 636588f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ interface Anime : SAnime {
var cover_last_modified: Long

fun setEpisodeOrder(order: Int) {
setEpisodeFlags(order, EPISODE_SORTING_MASK)
setEpisodeFlags(order, EPISODE_SORT_MASK)
}

fun sortDescending(): Boolean {
return episode_flags and EPISODE_SORTING_MASK == EPISODE_SORTING_MASK
return episode_flags and EPISODE_SORT_MASK == EPISODE_SORT_DESC
}

fun getGenres(): List<String>? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ class AnimeController :
val activity = activity ?: return
launchIO {
val episodeList = ArrayList<Episode>()
val list = presenter.filteredAndSortedEpisodes.reversed()
val list = presenter.filteredAndSortedEpisodes
val idx = list.indexOf(EpisodeItem(episode, anime!!))
val upper = if (list.lastIndex < idx + 100) list.lastIndex else idx + 100
val lower = if (0 > idx - 100) 0 else idx - 100
Expand Down

0 comments on commit 636588f

Please sign in to comment.