Some fixes

This commit is contained in:
localhost_frssoft 2022-07-18 10:59:56 +03:00
parent 3ed5abe8e1
commit 67911414a2

View file

@ -73,21 +73,12 @@ funkwhale_api_get_tracks()
play_or_download_selected() play_or_download_selected()
{ {
mkdir -p music_dl mkdir -p music_dl
if [ -n "$auth" ]; then
if [ "$download_selected_track" = 'true' ]; then if [ "$download_selected_track" = 'true' ]; then
default_curl_opt --tcp-fastopen --output - --url "https://$instance$download_track&token=$listen_token" | \ 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 - tee "music_dl/$artist_name - $title.$download_ext" | $default_player_command -
else else
$default_player_command "https://$instance$play_track?token=$listen_token" $default_player_command "https://$instance$play_track?token=$listen_token"
fi fi
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
fi
} }
funkwhale_menu_tracks() funkwhale_menu_tracks()
@ -102,8 +93,8 @@ funkwhale_menu_tracks()
counter_titles=0 counter_titles=0
while [ $sub2_menu -eq $level ]; do while [ $sub2_menu -eq $level ]; do
titles=$(jj -i preload -l results.#.title | nl -s: -v0 -w1) titles=$(jj -i preload -l 'results.#.title' | nl -s: -v0 -w1)
playlist=$(jj -i preload -l results.#.listen_url | delq) playlist=$(jj -i preload -l 'results.#.listen_url' | delq)
menu_album_tracks_choice=$(echo "Back\nMain menu\nListen all\n$titles" | fzy) menu_album_tracks_choice=$(echo "Back\nMain menu\nListen all\n$titles" | fzy)
case $menu_album_tracks_choice in case $menu_album_tracks_choice in
"Back") "Back")
@ -124,11 +115,7 @@ funkwhale_menu_tracks()
duration=$(jj -i preload results."$counter_titles".uploads.0.duration) duration=$(jj -i preload results."$counter_titles".uploads.0.duration)
echo "#EXTINF:$duration, $artist_name - $title" >> playlist.m3u8 echo "#EXTINF:$duration, $artist_name - $title" >> playlist.m3u8
counter_titles=$(expr $counter_titles + 1) counter_titles=$(expr $counter_titles + 1)
if [ -n "$auth" ]; then
echo "https://$instance$i&token=$listen_token\n" >> playlist.m3u8 echo "https://$instance$i&token=$listen_token\n" >> playlist.m3u8
else
echo "https://$instance$i\n" >> playlist.m3u8
fi
done done
$default_player_command playlist.m3u8 ;; $default_player_command playlist.m3u8 ;;
@ -300,11 +287,8 @@ funkwhale_api_get_tracks_from_channel()
*) *)
index=$(echo "$menu_podcast_choice" | cut -f 1 -d:) index=$(echo "$menu_podcast_choice" | cut -f 1 -d:)
play_track=$(echo "$track_list" | jj results."$index".listen_url) play_track=$(echo "$track_list" | jj results."$index".listen_url)
if [ -n "$auth" ]; then
$default_player_command "https://$instance$play_track&token=$listen_token" $default_player_command "https://$instance$play_track&token=$listen_token"
else ;;
$default_player_command "https://$instance$play_track"
fi ;;
esac esac
done done
} }