Compare commits

...

2 commits

Author SHA1 Message Date
localhost_frssoft 67911414a2 Some fixes 2022-07-18 10:59:56 +03:00
localhost_frssoft 3ed5abe8e1 Formated playlist and fid comment 2022-07-18 10:51:37 +03:00

View file

@ -73,20 +73,11 @@ funkwhale_api_get_tracks()
play_or_download_selected()
{
mkdir -p music_dl
if [ -n "$auth" ]; then
if [ "$download_selected_track" = 'true' ]; then
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 -
else
$default_player_command "https://$instance$play_track?token=$listen_token"
fi
if [ "$download_selected_track" = 'true' ]; then
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 -
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
$default_player_command "https://$instance$play_track?token=$listen_token"
fi
}
@ -102,8 +93,8 @@ funkwhale_menu_tracks()
counter_titles=0
while [ $sub2_menu -eq $level ]; do
titles=$(jj -i preload -l results.#.title | nl -s: -v0 -w1)
playlist=$(jj -i preload -l results.#.listen_url | delq)
titles=$(jj -i preload -l 'results.#.title' | nl -s: -v0 -w1)
playlist=$(jj -i preload -l 'results.#.listen_url' | delq)
menu_album_tracks_choice=$(echo "Back\nMain menu\nListen all\n$titles" | fzy)
case $menu_album_tracks_choice in
"Back")
@ -124,11 +115,7 @@ funkwhale_menu_tracks()
duration=$(jj -i preload results."$counter_titles".uploads.0.duration)
echo "#EXTINF:$duration, $artist_name - $title" >> playlist.m3u8
counter_titles=$(expr $counter_titles + 1)
if [ -n "$auth" ]; then
echo "https://$instance$i&token=$listen_token\n" >> playlist.m3u8
else
echo "https://$instance$i\n" >> playlist.m3u8
fi
echo "https://$instance$i&token=$listen_token\n" >> playlist.m3u8
done
$default_player_command playlist.m3u8 ;;
@ -300,11 +287,8 @@ funkwhale_api_get_tracks_from_channel()
*)
index=$(echo "$menu_podcast_choice" | cut -f 1 -d:)
play_track=$(echo "$track_list" | jj results."$index".listen_url)
if [ -n "$auth" ]; then
$default_player_command "https://$instance$play_track&token=$listen_token"
else
$default_player_command "https://$instance$play_track"
fi ;;
$default_player_command "https://$instance$play_track&token=$listen_token"
;;
esac
done
}
@ -376,6 +360,7 @@ funkwhale_pseudofs_load()
get_tracks_uuid_by_artist_id=$(echo "$tracks" | jj -l "results.#[artist.id=$idartist]#.uploads.0.uuid" | delq)
for track in $get_tracks_uuid_by_artist_id; do
fid_url=$(echo "$tracks" | jj "results.#[uploads.0.uuid="$track"].fid")
artist_name=$(echo "$tracks" | jj "results.#[uploads.0.uuid="$track"].artist.name")
album_name=$(echo "$tracks" | jj "results.#[uploads.0.uuid="$track"].album.title")
track_name=$(echo "$tracks" | jj "results.#[uploads.0.uuid="$track"].title")
@ -389,7 +374,7 @@ funkwhale_pseudofs_load()
if [ -n "$exists_test" ]; then
skip_count=$(expr $skip_count + 1)
else
echo "#EXTINF:$duration, "$idartist"_$track_filename\n$full_url" >> "fwfs_$instance/$idartist/playlist.m3u8"
echo "#EXTINF:$duration, "$idartist"_$track_filename\n#$fid_url\n$full_url\n" >> "fwfs_$instance/$idartist/playlist.m3u8"
fi
tracks_counter_watch=$(expr $tracks_counter_watch + 1)
echo "current: $tracks_counter_watch skipped: $skip_count total: $count_all_tracks"