mirror of
http://gitea.phreedom.club/localhost_frssoft/pleroma-cli
synced 2025-01-12 02:19:31 +00:00
Added autoupdate statuses; fixed timestamp for statuses dirs
This commit is contained in:
parent
d8e6271d8f
commit
e3844feb45
|
@ -979,8 +979,21 @@ custom_manual_api_request()
|
|||
done
|
||||
}
|
||||
|
||||
if [ "$1" = '--daemon' ]; then
|
||||
statuses_auto_update()
|
||||
{
|
||||
while true; do
|
||||
echo "Updating statuses..."
|
||||
timeline='home'
|
||||
export instance
|
||||
timeline_api | ./utils/statuses2files.sh
|
||||
echo "Waiting..."
|
||||
sleep 30
|
||||
done
|
||||
}
|
||||
|
||||
if [ "$daemon_mode" = 'yes' ]; then
|
||||
echo "Daemon mode started; files listening..."
|
||||
statuses_auto_update &
|
||||
while true; do
|
||||
sleep 5
|
||||
statuses_to_fav=$(/bin/ls $main_basedir/all_statuses/$instance/*/favourite 2>/dev/null)
|
||||
|
@ -997,6 +1010,7 @@ if [ "$1" = '--daemon' ]; then
|
|||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
menu_write_status='Write status'
|
||||
menu_timeline='Timelines'
|
||||
notif='Notifications'
|
||||
|
|
|
@ -14,7 +14,6 @@ for i in $ids; do
|
|||
status_media_attachments=$(echo "$json" | jj -l "#[id=$i].media_attachments.#.url" | tr -d '"\v')
|
||||
|
||||
chmod 711 "$main_basedir"/all_statuses/$instance/$status_id
|
||||
touch -d "$status_date" "$main_basedir"/all_statuses/$instance/$status_id
|
||||
|
||||
if [ -n "$content" ]; then
|
||||
echo "$content" > "$main_basedir"/all_statuses/$instance/$status_id/content
|
||||
|
@ -23,6 +22,7 @@ for i in $ids; do
|
|||
echo "$status_media_attachments" > "$main_basedir"/all_statuses/$instance/$status_id/media_attachments.m3u8
|
||||
fi
|
||||
chmod 600 "$main_basedir"/all_statuses/$instance/$status_id/*
|
||||
touch -d "$status_date" "$main_basedir"/all_statuses/$instance/$status_id
|
||||
done
|
||||
|
||||
export ids
|
||||
|
|
|
@ -15,7 +15,9 @@ for i in $ids; do
|
|||
ids=$(echo "$ids" | sed -E "s/.?$i.?//g")
|
||||
continue
|
||||
fi
|
||||
status_date=$(echo "$json" | jj "#[id=$1].created_at")
|
||||
mkdir -m 711 -p "$main_basedir"/all_statuses/$instance/$i
|
||||
touch -d "$status_date" "$main_basedir"/all_statuses/$instance/$i
|
||||
echo "$json" | jj -p "#[id=$i]" > "$main_basedir"/all_statuses/$instance/$i/$i.json
|
||||
done
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ for i in $ids; do
|
|||
mkdir -m 711 -p "$main_basedir"/statuses/$instance/$acct
|
||||
if [ -n "$status_id" ]; then
|
||||
ln -s -r "$main_basedir"/all_statuses/$instance/$status_id "$main_basedir"/statuses/$instance/$acct/$status_id
|
||||
touch --reference "$main_basedir"/all_statuses/$instance/$status_id "$main_basedir"/statuses/$instance/$acct/$status_id
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
Loading…
Reference in a new issue