From 0476ad02cc0c813266ef8c80ea1796f187c94884 Mon Sep 17 00:00:00 2001 From: Lamido Tijjani Date: Wed, 26 Jun 2024 12:05:22 +0100 Subject: [PATCH] fix: Correct logic for local music playback to start from selected track - Adjusted logic to use the full path stored in the `local_music` array instead of "$mDIR/$choice" - Modified `play_local_music` function to use `${local_music[@]}` for `mpv` command. - Ensured the entire playlist is considered when starting from a specific index. --- config/hypr/UserScripts/RofiBeats.sh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/config/hypr/UserScripts/RofiBeats.sh b/config/hypr/UserScripts/RofiBeats.sh index 7a7ac3f..b9e9ba0 100755 --- a/config/hypr/UserScripts/RofiBeats.sh +++ b/config/hypr/UserScripts/RofiBeats.sh @@ -56,16 +56,9 @@ play_local_music() { notification "$choice" - # For some reason wont start playlist at 0 - if [[ $i -eq 0 ]]; then - # Play the selected local music file using mpv - mpv --loop-playlist --vid=no "$mDIR/$choice" - - else - file=$i - # Play the selected local music file using mpv - mpv --playlist-start="$file" --loop-playlist --vid=no "$mDIR/$choice" - fi + # Play the selected local music file using mpv + mpv --playlist-start="$i" --loop-playlist --vid=no "${local_music[@]}" + break fi done