Skip to content

Commit 5677189

Browse files
committed
Sort episodes before Continue
1 parent 40b5fc2 commit 5677189

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/src/main/java/com/lamndt/smartmovie/EntityDetailScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ private fun SeasonContent(
264264
}
265265
}) { Text(stringResource(if (seasonWatched) R.string.mark_season_unwatched else R.string.mark_season_watched)) }
266266
if (!seasonWatched) {
267-
val next = value.episodes.firstOrNull { it.episodeNumber !in watched }
267+
val next = value.episodes.sortedBy { it.episodeNumber }.firstOrNull { it.episodeNumber !in watched }
268268
next?.let { episode ->
269269
OutlinedButton(onClick = { onEntity(CatalogEntity.Episode(episode)) }) {
270270
Text(stringResource(R.string.continue_with_episode))

0 commit comments

Comments
 (0)