This commit is contained in:
2023-03-01 14:23:24 +01:00
parent 5aaf543ad3
commit 8814740b6f

View File

@@ -590,7 +590,7 @@ soco() {
49) play_shared_link;; 49) play_shared_link;;
50|b|B) search_album_from_library;; 50|b|B) search_album_from_library;;
51|x|X) search_artist_from_library;; 51|x|X) search_artist_from_library;;
52|y|Y) play_track_from_library;; 52|y|Y) search_tracks_from_library;;
53) play_uri;; 53) play_uri;;
54) make_playlist;; 54) make_playlist;;
55|j|J) sleeep;; 55|j|J) sleeep;;
@@ -1296,7 +1296,7 @@ search_artist_from_library() {
if [ -z "$l_alb" ]; then if [ -z "$l_alb" ]; then
l_alb=$(sonos $loc $device list_albums | tail -n+4 | grep -i "$artiste") l_alb=$(sonos $loc $device list_albums | tail -n+4 | grep -i "$artiste")
#fi
echo -e "\n${underline}Albums from $artiste:${reset}" echo -e "\n${underline}Albums from $artiste:${reset}"
echo -e "$l_alb\n" echo -e "$l_alb\n"
if [ -n "$l_alb" ]; then if [ -n "$l_alb" ]; then
@@ -1333,23 +1333,20 @@ search_artist_from_library() {
search_album_from_library() { search_album_from_library() {
echo
#fzf_bin=0
if [ $fzf_bin -eq 1 ]; then if [ $fzf_bin -eq 1 ]; then
fzf_music_folder_args=( fzf_music_folder_args=(
--border --border
--exact --exact
--header="ENTER for select album; ESC for a new search"
) )
art=$(soco $loc $device list_albums | tail -n+4 | fzf "${fzf_music_folder_args[@]}") alb=$(sonos $loc $device list_albums | tail -n+4 | fzf "${fzf_music_folder_args[@]}")
#alb=$(cat list_albums.txt | tail -n+4 | fzf "${fzf_music_folder_args[@]}")
fi fi
if [ -z "$art" ]; then
#art=$(soco $loc $device list_artists | tail -n+4) if [ -z "$alb" ]; then
alb=$(cat list_albums.txt | tail -n+4) alb=$(sonos $loc $device list_albums | tail -n+4)
while : while :
do do
@@ -1360,6 +1357,8 @@ search_album_from_library() {
echo -e "$x\n" echo -e "$x\n"
fi fi
echo
if [ -n "$x" ]; then if [ -n "$x" ]; then
while : while :
@@ -1380,14 +1379,6 @@ search_album_from_library() {
fi fi
#sonos $loc $device clear_queue : $device queue_album "$album" : $device play_from_queue > /dev/null
#sonos $device queue_album "$album" next : $device play_from_queue # ajoute en pos 2 et joue
#sonos $loc $device queue_album "$album" first : $device play_from_queue # ajoute en pos 1 et joue
#sonos $loc $device list_queue
if [ -n "$alb" ]; then if [ -n "$alb" ]; then
artiste=$(echo "$alb" | awk -F":" '{print $4}' | awk -F"|" '{print $1}' | sed 's/^[[:blank:]]*//;s/[[:blank:]]*$//') artiste=$(echo "$alb" | awk -F":" '{print $4}' | awk -F"|" '{print $1}' | sed 's/^[[:blank:]]*//;s/[[:blank:]]*$//')
album=$(echo "$alb" | awk -F":" '{print $3}' | awk -F"|" '{print $1}' | sed 's/^[[:blank:]]*//;s/[[:blank:]]*$//') # xargs: unterminated quote album=$(echo "$alb" | awk -F":" '{print $3}' | awk -F"|" '{print $1}' | sed 's/^[[:blank:]]*//;s/[[:blank:]]*$//') # xargs: unterminated quote
@@ -1401,7 +1392,6 @@ search_album_from_library() {
_tia "$album" _tia "$album"
fi fi
} }
@@ -1435,7 +1425,7 @@ search_tracks_from_library() {
fzf_music_folder_args=( fzf_music_folder_args=(
--border --border
--exact --exact
--header="ENTER for select; ESC for a new search" --header="ENTER for select track; ESC for a new search"
) )
trk=$(echo "$tracks" | fzf "${fzf_music_folder_args[@]}") trk=$(echo "$tracks" | fzf "${fzf_music_folder_args[@]}")
[ -n "$trk" ] && break [ -n "$trk" ] && break
@@ -2902,14 +2892,14 @@ cli_help(){
printf "| ${bold}%-25s${reset} | %-126s \n" "alarms" "List all of the alarms in the Sonos system." printf "| ${bold}%-25s${reset} | %-126s \n" "alarms" "List all of the alarms in the Sonos system."
echo -e "\n${greenbold}Play${reset}" echo -e "\n${greenbold}Play${reset}"
printf "| ${bold}%-25s${reset} | %-126s \n" "play_album_from_library" "Search album in library -> add to queue -> play." printf "| ${bold}%-25s${reset} | %-126s \n" "search_album_from_library" "Search album in library -> add to queue -> play."
printf "| ${bold}%-25s${reset} | %-126s \n" "play_artist_from_library" "Search artist in library -> add to queue -> play." printf "| ${bold}%-25s${reset} | %-126s \n" "search_artist_from_library" "Search artist in library -> add to queue -> play."
printf "| ${bold}%-25s${reset} | %-126s \n" "play_local_dir" "Play all of the audio files in the specified local directory (does not traverse into subdirectories)" printf "| ${bold}%-25s${reset} | %-126s \n" "play_local_dir" "Play all of the audio files in the specified local directory (does not traverse into subdirectories)"
printf "| ${bold}%-25s${reset} | %-126s \n" "play_local_file" "Play MP3, M4A, MP4, FLAC, OGG, WMA, WAV, or AIFF audio files from your computer. Multiple filenames can be provided and will be played in sequence." printf "| ${bold}%-25s${reset} | %-126s \n" "play_local_file" "Play MP3, M4A, MP4, FLAC, OGG, WMA, WAV, or AIFF audio files from your computer. Multiple filenames can be provided and will be played in sequence."
printf "| ${bold}%-25s${reset} | %-126s \n" "play_local_m3u" "Plays a local M3U/M3U8 playlist consisting of local audio files (in supported audio formats)" printf "| ${bold}%-25s${reset} | %-126s \n" "play_local_m3u" "Plays a local M3U/M3U8 playlist consisting of local audio files (in supported audio formats)"
printf "| ${bold}%-25s${reset} | %-126s \n" "play_radio_from_tunein" "Play favorite from TuneIn radio." printf "| ${bold}%-25s${reset} | %-126s \n" "play_radio_from_tunein" "Play favorite from TuneIn radio."
printf "| ${bold}%-25s${reset} | %-126s \n" "play_shared_link" "Play a shared link from Deezer,Spotify, Tidal or Apple Music." printf "| ${bold}%-25s${reset} | %-126s \n" "play_shared_link" "Play a shared link from Deezer,Spotify, Tidal or Apple Music."
printf "| ${bold}%-25s${reset} | %-126s \n" "play_track_from_library" "Search track in library -> add to queue -> play." printf "| ${bold}%-25s${reset} | %-126s \n" "search_track_from_library" "Search track in library -> add to queue -> play."
printf "| ${bold}%-25s${reset} | %-126s \n" "play_uri" "Plays the audio object given by the <uri> parameter (e.g., a radio stream URL)" printf "| ${bold}%-25s${reset} | %-126s \n" "play_uri" "Plays the audio object given by the <uri> parameter (e.g., a radio stream URL)"
echo -e "\n${greenbold}Alarms${reset}" echo -e "\n${greenbold}Alarms${reset}"