From ce9575dac5cbc20eb1838fd760929b461060c0a9 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Sat, 2 Apr 2022 13:16:13 +0300 Subject: [PATCH] Fixes in podcasts --- funkwhale-cli.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/funkwhale-cli.sh b/funkwhale-cli.sh index a1b7fc2..d4b195b 100755 --- a/funkwhale-cli.sh +++ b/funkwhale-cli.sh @@ -36,17 +36,20 @@ funkwhale_get_podcasts_artists() counter=0 count_artists=$(jj -i preload count) echo "$count_artists avalaible" - artist_channels=$(jj -i preload -l 'results.#.channel.uuid' | sed 's/"//g') - artist_names=$(mktemp) + artist_channels=$(jj -l -i preload 'results.#.channel.uuid' | sed 's/"//g') + podcast_names=$(jj -l -i preload results.#.name | sed 's/\./_/g' | sed 's/"//g') temp_artists=$(mktemp) for i in $artist_channels; do - jj -i preload results."$counter".name | sed 's/\./_/g' >> $artist_names - jj -i $temp_artists -v "$i" -o $temp_artists "$(jj -i preload results.$counter.name | sed 's/\./_/g')" + jj -i $temp_artists -v "$i" -o $temp_artists "$(jj -i preload results.$counter.name | sed 's/\./_/g' | sed 's/\"//g')" counter=$(expr $counter + 1) done - menu_artist_choice=$(cat $artist_names | fzy) - channel_uuid=$(jj -i $temp_artists "$menu_artist_choice") - funkwhale_api_get_tracks_from_channel $channel_uuid + menu_podcast_choice=$(echo $podcast_names | fzy) + channel_uuid=$(jj -i $temp_artists "$menu_podcast_choice") + if [ -z $channel_uuid ]; then + echo 'Error when loading podcast' + else + funkwhale_api_get_tracks_from_channel $channel_uuid + fi } load_tracks_to_playlist()