move logic
This commit is contained in:
parent
ee9f3c02f0
commit
8ee1e35e77
|
@ -21,6 +21,10 @@ protocol EpisodesRowManager: ViewModel {
|
|||
|
||||
extension EpisodesRowManager {
|
||||
|
||||
var sortedSeasons: [BaseItemDto] {
|
||||
Array(seasonsEpisodes.keys).sorted(by: { $0.indexNumber ?? 0 < $1.indexNumber ?? 0 })
|
||||
}
|
||||
|
||||
// Also retrieves the current season episodes if available
|
||||
func retrieveSeasons() {
|
||||
TvShowsAPI.getSeasons(seriesId: item.seriesId ?? "",
|
||||
|
|
|
@ -29,7 +29,7 @@ struct EpisodesRowView<RowManager>: View where RowManager: EpisodesRowManager {
|
|||
}
|
||||
} else {
|
||||
Menu {
|
||||
ForEach(Array(viewModel.seasonsEpisodes.keys).sorted(by: { $0.indexNumber ?? 0 < $1.indexNumber ?? 0 }),
|
||||
ForEach(viewModel.sortedSeasons,
|
||||
id: \.self) { season in
|
||||
Button {
|
||||
viewModel.select(season: season)
|
||||
|
|
Loading…
Reference in New Issue