Fix making posts sans media
This commit is contained in:
parent
6e78e53b08
commit
92b9476c87
|
@ -23,9 +23,8 @@ file_status() {
|
||||||
local file="$1"
|
local file="$1"
|
||||||
local id="$(head -1 "$file" | awk '{print $3}')"
|
local id="$(head -1 "$file" | awk '{print $3}')"
|
||||||
local url="$(head -1 "$file" | awk '{print $4}')"
|
local url="$(head -1 "$file" | awk '{print $4}')"
|
||||||
tail +4 "$file" \
|
tail +2 "$file" \
|
||||||
| sanitize_text \
|
| sanitize_text
|
||||||
| grep -v "$id"
|
|
||||||
if test -n "$url"; then
|
if test -n "$url"; then
|
||||||
printf '<br/>[<a href=\\"%s\\">Originala afiŝo</a>]\\n' "$url"
|
printf '<br/>[<a href=\\"%s\\">Originala afiŝo</a>]\\n' "$url"
|
||||||
fi
|
fi
|
||||||
|
@ -35,12 +34,16 @@ file_status() {
|
||||||
# Turns a space-delimited list of uploaded media-IDs into a JSON array.
|
# Turns a space-delimited list of uploaded media-IDs into a JSON array.
|
||||||
media_json() {
|
media_json() {
|
||||||
local ids="$1"
|
local ids="$1"
|
||||||
|
if test -n "$ids"; then
|
||||||
echo "$ids" \
|
echo "$ids" \
|
||||||
| sed 's%^ %%' \
|
| sed 's%^ %%' \
|
||||||
| sed 's% $%%' \
|
| sed 's% $%%' \
|
||||||
| sed 's%^%["%' \
|
| sed 's%^%["%' \
|
||||||
| sed 's% %","%g' \
|
| sed 's% %","%g' \
|
||||||
| sed 's%$%"]%'
|
| sed 's%$%"]%'
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Ŝarĝante…
Reference in New Issue