render statuses format more readable

This commit is contained in:
localhost_frssoft 2022-04-15 20:05:15 +03:00
parent 098669af16
commit 34439334f1
2 changed files with 10 additions and 5 deletions

View file

@ -6,6 +6,7 @@
"default_visibility": "unlisted", "default_visibility": "unlisted",
"format_time": "+%d.%m.%Y %H:%M:%S", "format_time": "+%d.%m.%Y %H:%M:%S",
"boost_symbol": "[>>]", "boost_symbol": "[>>]",
"statuses_separator": "\n==========",
"reversed_statuses": false, "reversed_statuses": false,
"quoting_reply": true, "quoting_reply": true,
"public_list_instances": [ "public_list_instances": [

View file

@ -11,6 +11,7 @@ default_visibility=$(jj -i config.json default_visibility)
default_content_type=$(jj -i config.json default_content_type) default_content_type=$(jj -i config.json default_content_type)
format_time=$(jj -i config.json format_time) format_time=$(jj -i config.json format_time)
boost_symbol=$(jj -i config.json boost_symbol) boost_symbol=$(jj -i config.json boost_symbol)
statuses_separator=$(jj -i config.json statuses_separator)
reversed_statuses=$(jj -i config.json reversed_statuses) reversed_statuses=$(jj -i config.json reversed_statuses)
quoting_reply=$(jj -i config.json quoting_reply) quoting_reply=$(jj -i config.json quoting_reply)
@ -322,18 +323,21 @@ statuses_render()
fi fi
for i in $ids_massive; do for i in $ids_massive; do
status=$(echo "$jsonmassive" | jj "#[id=$i]") status=$(echo "$jsonmassive" | jj "#[id=$i]")
whoacct=$(echo $status | jj account.acct)
reblog=$(echo $status | jj reblog.id) reblog=$(echo $status | jj reblog.id)
uri=$(echo $status | jj uri) uri=$(echo $status | jj uri)
id_status=$(echo $status | jj id) id_status=$(echo $status | jj id)
dateutc=$(echo $status | jj created_at) dateutc=$(echo $status | jj created_at)
reply_to_id=$(echo $status | jj in_reply_to_id) reply_to_id=$(echo $status | jj in_reply_to_id)
echo "$(date -d $dateutc "$format_time") <$id_status> $uri" visibility_status=$(echo $status | jj visibility)
echo "| $(date -d $dateutc "$format_time") $visibility_status $whoacct"
echo "| <$id_status> $uri"
if [ -n "$reply_to_id" ]; then if [ -n "$reply_to_id" ]; then
echo "Reply to: $reply_to_id" echo "| Reply to: $reply_to_id"
fi fi
if [ -n "$reblog" ]; then if [ -n "$reblog" ]; then
echo "$boost_symbol $reblog" echo "| $boost_symbol $reblog"
fi fi
spoiler_text=$(echo "$status" | jj spoiler_text) spoiler_text=$(echo "$status" | jj spoiler_text)
if [ -n "$spoiler_text" ]; then if [ -n "$spoiler_text" ]; then
@ -345,7 +349,7 @@ statuses_render()
echo "#EXTINF:-1, $uri" >> attachments.m3u8 echo "#EXTINF:-1, $uri" >> attachments.m3u8
echo "$attachments" >> attachments.m3u8 echo "$attachments" >> attachments.m3u8
fi fi
echo '==========' echo "$statuses_separator"
done done
} }