From 9e252d492cc54ac57fc4d60daeb965d5401e79ee Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Thu, 31 Mar 2022 21:19:08 +0300 Subject: [PATCH] added search by tag --- config.json | 11 +++++++++++ funkwhale-cli.sh | 8 +++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/config.json b/config.json index 2b18d77..dcd64ab 100644 --- a/config.json +++ b/config.json @@ -1,3 +1,14 @@ { "instance": "sound.redeyes.club" + "tags": [ + "TagOFF", + "8bit", + "Ambient", + "Bluez", + "Reggae", + "Electronic", + "Electronica", + "Classic", + "Violin" + ] } diff --git a/funkwhale-cli.sh b/funkwhale-cli.sh index c368259..fbc0b99 100755 --- a/funkwhale-cli.sh +++ b/funkwhale-cli.sh @@ -11,7 +11,7 @@ funkwhale_api_check_api_limits() funkwhale_api_get_tracks() { - get_json=$(curl -s --compressed "https://$instance/api/v1/tracks?ordering=$ordering&playable=true&page=$1" 2>&1 | tee preload) + get_json=$(curl -s --compressed "https://$instance/api/v1/tracks?ordering=$ordering&playable=true&page=$1&tag=$tag" 2>&1 | tee preload) jj -i preload -l 'results.#.uploads.0.listen_url' | sed 's/"//g' } @@ -90,6 +90,12 @@ if [ "$choice" = "$downloadtrackspls" ]; then echo 'Order by (prefix - is DESC ordering):' ordering=$(echo 'title\n-title\ncreation_date\n-creation_date\nrelease_date\n-release_date\nrandom' | fzy) export ordering + echo 'Tags:' + tag=$(jj -l -i config.json tags | sed 's/"//g' | fzy) + if [ "$tag" = "TagOFF" ]; then + tag= + fi + export tag echo 'Enter page number: ' read page load_tracks_to_playlist $page