Skip to content

Commit

Permalink
fix playlist loading
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMoonThatRises committed Dec 5, 2024
1 parent 620cec6 commit dfee6c3
Showing 1 changed file with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,26 @@ struct PlaylistTopElement: View {
avAudioPlayer.addBulkSongs(
tracks: avAudioPlayer.isShuffled ? tracks.shuffled() : tracks
)

avAudioPlayer.playingId = playlist?.id
} label: {
Image(avAudioPlayer.playingId == playlist?.id ? "spwifiy.pause.fill" : "spwifiy.play.fill")
.resizable()
.frame(width: 40, height: 40)
Group {
if tracks.isEmpty {
ProgressView()
.progressViewStyle(.circular)
} else {
Image(
avAudioPlayer.playingId == playlist?.id &&
avAudioPlayer.isPlaying ? "spwifiy.pause.fill" : "spwifiy.play.fill"
)
.resizable()
}
}
.frame(width: 40, height: 40)
}
.buttonStyle(.plain)
.cursorHover(.pointingHand)
.disabled(tracks.isEmpty)

DotButton(toggle: $avAudioPlayer.isShuffled,
image: Image("spwifiy.shuffle"))
Expand All @@ -98,6 +111,7 @@ struct PlaylistTopElement: View {
}
.buttonStyle(.plain)
.cursorHover(.pointingHand)
.disabled(tracks.isEmpty)

Button {

Expand Down

0 comments on commit dfee6c3

Please sign in to comment.