From 30ac2c503b92f3e1b8ea4fffcd080035f1a89dd0 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Fri, 15 Apr 2022 22:11:29 +0300 Subject: [PATCH] Added gzip compression for instance tags --- funkwhale-cli.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/funkwhale-cli.sh b/funkwhale-cli.sh index 47c7298..2c9aade 100755 --- a/funkwhale-cli.sh +++ b/funkwhale-cli.sh @@ -30,20 +30,21 @@ funkwhale_api_check_api_limits() funkwhale_api_tags() { mkdir -p tags_db - if [ ! -f "tags_db/tags_$instance" ]; then + if [ ! -f "tags_db/tags_$instance.gz" ]; then tagsload=$(default_curl_opt "$instance_point/tags?playable=true") pageindex=$(echo $tagsload | jj next) - echo $tagsload | jj -l results.#.name | sed 's/"//g' > tags_db/tags_$instance + echo $tagsload | jj -l results.#.name | sed 's/"//g' | gzip > tags_db/tags_$instance.gz clear while [ -n "$pageindex" ]; do echo "Loading... +$(echo $tagsload | jj results.#) tags" - echo $tagsload | jj -l results.#.name | sed 's/"//g' >> tags_db/tags_$instance + echo $tagsload | jj -l results.#.name | sed 's/"//g' | gzip >> tags_db/tags_$instance.gz pageindex=$(echo $tagsload | jj next) tagsload=$(default_curl_opt "$pageindex") sleep 1 done fi - tag=$(cat tags_db/tags_$instance | fzy) + + tag=$(cat tags_db/tags_$instance.gz | gzip -d | fzy) } funkwhale_api_get_tracks()