Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add playLikedTracks and handle likes screen playback

Rename playAllTrack to playAllTracks Add playLikedTracks gRPC wrapper to
play liked songs Add isLikesScreen flag to SongRowView and pass it from
LikesListView so rows play liked tracks when triggered

+23 -3
macos/Rockbox.xcodeproj/project.xcworkspace/xcuserdata/tsirysandratraina.xcuserdatad/UserInterfaceState.xcuserstate

This is a binary file and will not be displayed.

+16 -1
macos/Rockbox/Services/PlaybackService.swift
··· 175 175 } 176 176 } 177 177 178 - func playAllTrack(shuffle: Bool = false, position: Int32 = 0, host: String = "127.0.0.1", port: Int = 6061) async throws -> Void { 178 + func playAllTracks(shuffle: Bool = false, position: Int32 = 0, host: String = "127.0.0.1", port: Int = 6061) async throws -> Void { 179 179 try await withGRPCClient( 180 180 transport: .http2NIOPosix( 181 181 target: .dns(host: host, port: port), ··· 187 187 req.shuffle = shuffle 188 188 req.position = position 189 189 let _ = try await playback.playAllTracks(req) 190 + } 191 + } 192 + 193 + func playLikedTracks(shuffle: Bool = false, position: Int32 = 0, host: String = "127.0.0.1", port: Int = 6061) async throws -> Void { 194 + try await withGRPCClient( 195 + transport: .http2NIOPosix( 196 + target: .dns(host: host, port: port), 197 + transportSecurity: .plaintext 198 + ) 199 + ) { grpcClient in 200 + let playback = Rockbox_V1alpha1_PlaybackService.Client(wrapping: grpcClient) 201 + var req = Rockbox_V1alpha1_PlayLikedTracksRequest() 202 + req.shuffle = shuffle 203 + req.position = position 204 + let _ = try await playback.playLikedTracks(req) 190 205 } 191 206 } 192 207
+1 -1
macos/Rockbox/Views/Likes/LikesListView.swift
··· 59 59 60 60 // Liked song rows 61 61 ForEach(Array(likedSongs.enumerated()), id: \.element.id) { index, song in 62 - SongRowView(song: song, index: index + 1, isEven: index % 2 == 0, showLike: true, library: library) 62 + SongRowView(song: song, index: index + 1, isEven: index % 2 == 0, showLike: true, isLikesScreen: true, library: library) 63 63 } 64 64 } 65 65 }
+6 -1
macos/Rockbox/Views/Songs/SongRowView.swift
··· 12 12 let index: Int 13 13 let isEven: Bool 14 14 var showLike: Bool = false 15 + var isLikesScreen: Bool = false 15 16 @State private var errorText: String? 16 17 @ObservedObject var library: MusicLibrary 17 18 ··· 26 27 Button(action: { 27 28 Task { 28 29 do { 29 - try await playAllTrack(position: Int32(index) - 1) 30 + if isLikesScreen { 31 + try await playLikedTracks(position: Int32(index) - 1) 32 + return 33 + } 34 + try await playAllTracks(position: Int32(index) - 1) 30 35 } catch { 31 36 errorText = String(describing: error) 32 37 }