From 02cff53107c3cd182c71e1d60df46dad033980be Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Tue, 19 Apr 2022 15:10:14 +0300 Subject: [PATCH] Hiden "Media" button if attachments empty --- pleroma-cli.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pleroma-cli.sh b/pleroma-cli.sh index 39e618a..1f5160a 100755 --- a/pleroma-cli.sh +++ b/pleroma-cli.sh @@ -355,9 +355,11 @@ statuses_render() fi echo "$status" | jj -r content | delqse | html_to_txt_render attachments=$(echo "$status" | jj -l media_attachments.#.remote_url | delq) + menuattachments= if [ -n "$attachments" ]; then echo "#EXTINF:-1, $uri" >> attachments.m3u8 echo '[Attachments:]' + menuattachments='\nMedia' echo "$attachments" | tee -a attachments.m3u8 fi echo "$statuses_separator" @@ -365,7 +367,7 @@ statuses_render() next=0 force_stop=0 while [ "$next" -eq 0 ]; do - per_status_menu=$(echo 'Next\nMedia\nShare and favorite\nShare\nFavorite\nReply\nBack' | fzy) + per_status_menu=$(echo "Next$menuattachments\nShare and favorite\nShare\nFavorite\nReply\nBack" | fzy) case "$per_status_menu" in "Next") next=1; clear ;; "Media")