sub menu reconfigured

This commit is contained in:
localhost_frssoft 2022-04-04 00:58:18 +03:00
parent e7ca06a9e8
commit 2c942fd994

View File

@ -19,37 +19,46 @@ funkwhale_api_get_tracks()
funkwhale_api_get_tracks_from_channel()
{
sub_menu=1
sub2_menu=1
track_list=$(curl -s --compressed "$instance_point/tracks?channel=$1&playable=true&include_channels=true")
echo "Loaded $(echo $track_list | jj count) podcasts"
while [ $sub_menu -eq 1 ]; do
menu_podcast_choice=$(echo $track_list | jj -l 'results.#.title' | fzy)
while [ $sub2_menu -eq 1 ]; do
titles=$(echo $track_list | jj -l 'results.#.title')
menu_podcast_choice=$(echo "Main menu\nBack\n$titles" | fzy)
case $menu_podcast_choice in
"Main menu") sub2_menu=0 && sub_menu=0 ;;
"Back") sub2_menu=0 ;;
*)
play_track=$(echo $track_list | jj results.#[title="$menu_podcast_choice"].listen_url)
$default_player_command "https://$instance$play_track"
case $(echo "Back\nMain menu" | fzy) in
"Back") echo '' ;;
"Main menu") sub_menu=0 ;;
$default_player_command "https://$instance$play_track" ;;
esac
done
}
funkwhale_get_podcasts_artists()
{
sub_menu=1
echo 'Loading podcast artists...'
curl -s --compressed --output preload "$instance_point/artists?ordering=-creation_date&playable=true&include_channels=true&content_category=podcast&page=$1"
while [ $sub_menu -eq 1 ]; do
count_artists=$(jj -i preload count)
echo "$count_artists avalaible"
podcast_names=$(jj -l -i preload results.#.name)
menu_podcast_choice=$(echo "$podcast_names" | fzy)
menu_podcast_choice=$(echo "Main menu\n$podcast_names" | fzy)
case $menu_podcast_choice in
"Main menu") sub_menu=0 ;;
*)
channel_uuid=$(jj -i preload results.#[name="$menu_podcast_choice"].channel.uuid)
if [ -z $channel_uuid ]; then
echo 'Error when loading podcast'
else
funkwhale_api_get_tracks_from_channel $channel_uuid
fi
fi ;;
esac
done
}
load_tracks_to_playlist()