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
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")