mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-11-27 17:43:02 +00:00
Added view albums
This commit is contained in:
parent
3f97aad4b3
commit
2a74f746d1
@ -17,6 +17,48 @@ funkwhale_api_get_tracks()
|
|||||||
jj -i preload -l 'results.#.uploads.0.listen_url' | sed 's/"//g'
|
jj -i preload -l 'results.#.uploads.0.listen_url' | sed 's/"//g'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
funkwhale_api_get_albums()
|
||||||
|
{
|
||||||
|
get_json=$(curl -s --compressed "$instance_point/albums?ordering=$ordering&playable=true&page=$1" 2>&1 | tee preload)
|
||||||
|
}
|
||||||
|
|
||||||
|
funkwhale_menu_albums()
|
||||||
|
{
|
||||||
|
echo 'Loading albums...'
|
||||||
|
funkwhale_api_get_albums $1
|
||||||
|
echo "Avalaible $(jj -i preload count) albums"
|
||||||
|
sub_menu=1
|
||||||
|
while [ $sub_menu -eq 1 ]; do
|
||||||
|
titles=$(jj -i preload -l 'results.#.title')
|
||||||
|
menu_albums_choice=$(echo "Main menu\n$titles" | fzy)
|
||||||
|
case $menu_albums_choice in
|
||||||
|
"Main menu") sub_menu=0 ;;
|
||||||
|
*)
|
||||||
|
album_id=$(jj -i preload results.#[title="$menu_albums_choice"].id)
|
||||||
|
funkwhale_menu_albums_tracks $album_id
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
funkwhale_menu_albums_tracks()
|
||||||
|
{
|
||||||
|
sub2_menu=1
|
||||||
|
get_json=$(curl -s --compressed "$instance_point/tracks?ordering=$ordering&playable=true&album=$1&page_size=50")
|
||||||
|
|
||||||
|
|
||||||
|
while [ $sub2_menu -eq 1 ]; do
|
||||||
|
titles=$(echo $get_json | jj -l results.#.title)
|
||||||
|
menu_album_tracks_choice=$(echo "Back\nMain menu\n$titles" | fzy)
|
||||||
|
case $menu_album_tracks_choice in
|
||||||
|
"Back") sub2_menu=0 ;;
|
||||||
|
"Main menu") sub2_menu=0 && sub_menu=0 ;;
|
||||||
|
*)
|
||||||
|
play_track=$(echo $get_json | jj results.#[title="$menu_album_tracks_choice"].listen_url)
|
||||||
|
$default_player_command "https://$instance$play_track" ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
funkwhale_api_get_tracks_from_channel()
|
funkwhale_api_get_tracks_from_channel()
|
||||||
{
|
{
|
||||||
sub2_menu=1
|
sub2_menu=1
|
||||||
@ -99,13 +141,14 @@ get_all_avalaible_count_tracks
|
|||||||
|
|
||||||
downloadtrackspls='Download tracks in playlist'
|
downloadtrackspls='Download tracks in playlist'
|
||||||
startplayer='Start player'
|
startplayer='Start player'
|
||||||
|
albumsmenu='Albums'
|
||||||
podcasts='Podcasts'
|
podcasts='Podcasts'
|
||||||
changepod='Switch instance'
|
changepod='Switch instance'
|
||||||
checkapilimits='Check API limits (debug)'
|
checkapilimits='Check API limits (debug)'
|
||||||
Exit='Exit'
|
Exit='Exit'
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
choice=$(echo "$downloadtrackspls\n$startplayer\n$podcasts\n$changepod\n$checkapilimits\n$Exit" | fzy)
|
choice=$(echo "$downloadtrackspls\n$startplayer\n$albumsmenu\n$podcasts\n$changepod\n$checkapilimits\n$Exit" | fzy)
|
||||||
|
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
"$downloadtrackspls")
|
"$downloadtrackspls")
|
||||||
@ -126,6 +169,10 @@ case "$choice" in
|
|||||||
"$startplayer")
|
"$startplayer")
|
||||||
$default_player_command playlist.m3u8 ;;
|
$default_player_command playlist.m3u8 ;;
|
||||||
|
|
||||||
|
"$albumsmenu")
|
||||||
|
echo 'Enter page number: '
|
||||||
|
read page
|
||||||
|
funkwhale_menu_albums $page ;;
|
||||||
|
|
||||||
"$podcasts")
|
"$podcasts")
|
||||||
echo 'Enter page number: '
|
echo 'Enter page number: '
|
||||||
|
Loading…
Reference in New Issue
Block a user