ios: sort artists, albums, songs and playlists (1.0.5)
Plexamp-style sort menu on each library list: pick a field, pick it again to flip direction. Choice is saved per screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d149af336a
commit
65bc69a7fe
4 files changed
+155
-27
No files matched your search
@@ -6,6 +6,7 @@ struct PlaylistsScreen: View {
|
||||
@Environment(Ui.self) private var ui
|
||||
@State private var lists: LoadState<[Playlist]> = .loading
|
||||
@State private var reload = 0
|
||||
private let sort = SortState("playlists", PLAYLIST_SORTS)
|
||||
private var g: AppGraph { .shared }
|
||||
|
||||
var body: some View {
|
||||
@@ -21,12 +22,13 @@ struct PlaylistsScreen: View {
|
||||
}
|
||||
}
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .topBarTrailing) { SortMenu(sort: sort) }
|
||||
ToolbarItem(placement: .topBarTrailing) {
|
||||
Button { newPlaylist() } label: { Image(systemName: "plus") }
|
||||
}
|
||||
}
|
||||
.task(id: "\(g.settings.musicSection)|\(reload)") {
|
||||
await LoadState.load($lists) { try await g.plex.playlists() }
|
||||
.task(id: "\(g.settings.musicSection)|\(sort.param)|\(reload)") {
|
||||
await LoadState.load($lists) { try await g.plex.playlists(sort: sort.param) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user