Hiden "Media" button if attachments empty

This commit is contained in:
localhost_frssoft 2022-04-19 15:10:14 +03:00
parent 5ec56bc8a3
commit 02cff53107

View file

@ -355,9 +355,11 @@ statuses_render()
fi fi
echo "$status" | jj -r content | delqse | html_to_txt_render echo "$status" | jj -r content | delqse | html_to_txt_render
attachments=$(echo "$status" | jj -l media_attachments.#.remote_url | delq) attachments=$(echo "$status" | jj -l media_attachments.#.remote_url | delq)
menuattachments=
if [ -n "$attachments" ]; then if [ -n "$attachments" ]; then
echo "#EXTINF:-1, $uri" >> attachments.m3u8 echo "#EXTINF:-1, $uri" >> attachments.m3u8
echo '[Attachments:]' echo '[Attachments:]'
menuattachments='\nMedia'
echo "$attachments" | tee -a attachments.m3u8 echo "$attachments" | tee -a attachments.m3u8
fi fi
echo "$statuses_separator" echo "$statuses_separator"
@ -365,7 +367,7 @@ statuses_render()
next=0 next=0
force_stop=0 force_stop=0
while [ "$next" -eq 0 ]; do 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 case "$per_status_menu" in
"Next") next=1; clear ;; "Next") next=1; clear ;;
"Media") "Media")