From 67911414a2968ee5605f959be28fd0f490bd360a Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Mon, 18 Jul 2022 10:59:56 +0300 Subject: [PATCH] Some fixes --- funkwhale-cli.sh | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/funkwhale-cli.sh b/funkwhale-cli.sh index 2324571..e3983cc 100755 --- a/funkwhale-cli.sh +++ b/funkwhale-cli.sh @@ -73,20 +73,11 @@ funkwhale_api_get_tracks() play_or_download_selected() { mkdir -p music_dl - if [ -n "$auth" ]; then - if [ "$download_selected_track" = 'true' ]; then - default_curl_opt --tcp-fastopen --output - --url "https://$instance$download_track&token=$listen_token" | \ - tee "music_dl/$artist_name - $title.$download_ext" | $default_player_command - - else - $default_player_command "https://$instance$play_track?token=$listen_token" - fi + if [ "$download_selected_track" = 'true' ]; then + default_curl_opt --tcp-fastopen --output - --url "https://$instance$download_track&token=$listen_token" | \ + tee "music_dl/$artist_name - $title.$download_ext" | $default_player_command - else - if [ "$download_selected_track" = 'true' ]; then - default_curl_opt --tcp-fastopen --output - --url "https://$instance$download_track" | \ - tee "music_dl/$artist_name - $title.$download_ext" | $default_player_command - - else - $default_player_command "https://$instance$play_track" - fi + $default_player_command "https://$instance$play_track?token=$listen_token" fi } @@ -102,8 +93,8 @@ funkwhale_menu_tracks() counter_titles=0 while [ $sub2_menu -eq $level ]; do - titles=$(jj -i preload -l results.#.title | nl -s: -v0 -w1) - playlist=$(jj -i preload -l results.#.listen_url | delq) + titles=$(jj -i preload -l 'results.#.title' | nl -s: -v0 -w1) + playlist=$(jj -i preload -l 'results.#.listen_url' | delq) menu_album_tracks_choice=$(echo "Back\nMain menu\nListen all\n$titles" | fzy) case $menu_album_tracks_choice in "Back") @@ -124,11 +115,7 @@ funkwhale_menu_tracks() duration=$(jj -i preload results."$counter_titles".uploads.0.duration) echo "#EXTINF:$duration, $artist_name - $title" >> playlist.m3u8 counter_titles=$(expr $counter_titles + 1) - if [ -n "$auth" ]; then - echo "https://$instance$i&token=$listen_token\n" >> playlist.m3u8 - else - echo "https://$instance$i\n" >> playlist.m3u8 - fi + echo "https://$instance$i&token=$listen_token\n" >> playlist.m3u8 done $default_player_command playlist.m3u8 ;; @@ -300,11 +287,8 @@ funkwhale_api_get_tracks_from_channel() *) index=$(echo "$menu_podcast_choice" | cut -f 1 -d:) play_track=$(echo "$track_list" | jj results."$index".listen_url) - if [ -n "$auth" ]; then - $default_player_command "https://$instance$play_track&token=$listen_token" - else - $default_player_command "https://$instance$play_track" - fi ;; + $default_player_command "https://$instance$play_track&token=$listen_token" + ;; esac done }