mirror of
http://gitea.phreedom.club/localhost_frssoft/pleroma-cli
synced 2025-01-12 11:49:30 +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
|
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..."
|
echo "Daemon mode started; files listening..."
|
||||||
|
statuses_auto_update &
|
||||||
while true; do
|
while true; do
|
||||||
sleep 5
|
sleep 5
|
||||||
statuses_to_fav=$(/bin/ls $main_basedir/all_statuses/$instance/*/favourite 2>/dev/null)
|
statuses_to_fav=$(/bin/ls $main_basedir/all_statuses/$instance/*/favourite 2>/dev/null)
|
||||||
|
@ -997,6 +1010,7 @@ if [ "$1" = '--daemon' ]; then
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
menu_write_status='Write status'
|
menu_write_status='Write status'
|
||||||
menu_timeline='Timelines'
|
menu_timeline='Timelines'
|
||||||
notif='Notifications'
|
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')
|
status_media_attachments=$(echo "$json" | jj -l "#[id=$i].media_attachments.#.url" | tr -d '"\v')
|
||||||
|
|
||||||
chmod 711 "$main_basedir"/all_statuses/$instance/$status_id
|
chmod 711 "$main_basedir"/all_statuses/$instance/$status_id
|
||||||
touch -d "$status_date" "$main_basedir"/all_statuses/$instance/$status_id
|
|
||||||
|
|
||||||
if [ -n "$content" ]; then
|
if [ -n "$content" ]; then
|
||||||
echo "$content" > "$main_basedir"/all_statuses/$instance/$status_id/content
|
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
|
echo "$status_media_attachments" > "$main_basedir"/all_statuses/$instance/$status_id/media_attachments.m3u8
|
||||||
fi
|
fi
|
||||||
chmod 600 "$main_basedir"/all_statuses/$instance/$status_id/*
|
chmod 600 "$main_basedir"/all_statuses/$instance/$status_id/*
|
||||||
|
touch -d "$status_date" "$main_basedir"/all_statuses/$instance/$status_id
|
||||||
done
|
done
|
||||||
|
|
||||||
export ids
|
export ids
|
||||||
|
|
|
@ -15,7 +15,9 @@ for i in $ids; do
|
||||||
ids=$(echo "$ids" | sed -E "s/.?$i.?//g")
|
ids=$(echo "$ids" | sed -E "s/.?$i.?//g")
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
status_date=$(echo "$json" | jj "#[id=$1].created_at")
|
||||||
mkdir -m 711 -p "$main_basedir"/all_statuses/$instance/$i
|
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
|
echo "$json" | jj -p "#[id=$i]" > "$main_basedir"/all_statuses/$instance/$i/$i.json
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ for i in $ids; do
|
||||||
mkdir -m 711 -p "$main_basedir"/statuses/$instance/$acct
|
mkdir -m 711 -p "$main_basedir"/statuses/$instance/$acct
|
||||||
if [ -n "$status_id" ]; then
|
if [ -n "$status_id" ]; then
|
||||||
ln -s -r "$main_basedir"/all_statuses/$instance/$status_id "$main_basedir"/statuses/$instance/$acct/$status_id
|
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
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue