From e112a9dcaa7156034b47c7b6985a9823ad1122a3 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Sat, 2 Apr 2022 18:28:19 +0300 Subject: [PATCH] make choiseable podcast track --- funkwhale-cli.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/funkwhale-cli.sh b/funkwhale-cli.sh index 7526af9..b7e88fc 100755 --- a/funkwhale-cli.sh +++ b/funkwhale-cli.sh @@ -20,13 +20,21 @@ funkwhale_api_get_tracks_from_channel() { track_list=$(curl -s --compressed "$instance_point/tracks?channel=$1&playable=true&include_channels=true") echo "Loaded $(echo $track_list | jj count) podcasts" - echo $track_list | jj -l results.#.title + listen_urls=$(echo $track_list | jj -l results.#.listen_url | sed 's/"//g') echo > podcast.m3u8 + counter=0 + track_name_url="{}" for i in $listen_urls; do + title=$(echo $track_list | jj results.$counter.title | sed 's/["#\.]//g') + track_name_url_writer=$(echo $track_name_url | jj -v $i "$title") + track_name_url="${track_name_url_writer}" echo "https://$instance$i\n" >> podcast.m3u8 + counter=$(expr $counter + 1) done - $default_player_command podcast.m3u8 + menu_podcast_choice=$(echo $track_list | jj -l 'results.#.title' | sed 's/["#\.]//g' | fzy) + play_track=$(echo $track_name_url | jj "$menu_podcast_choice") + $default_player_command "https://$instance$play_track" } funkwhale_get_podcasts_artists()