mirror of
http://gitea.phreedom.club/localhost_frssoft/pleroma-cli
synced 2025-02-16 23:34:29 +00:00
Compare commits
2 commits
394901ece9
...
a85d67dab5
Author | SHA1 | Date | |
---|---|---|---|
|
a85d67dab5 | ||
|
a5e6ceb077 |
|
@ -809,7 +809,7 @@ if [ "$daemon_mode" = 'yes' ]; then
|
|||
statuses_auto_update &
|
||||
while true; do
|
||||
sleep 5
|
||||
for file_func in favourite share reply threadopen; do
|
||||
for file_func in favourite share reply threadopen prev; do
|
||||
statuses_file_action=$(/bin/ls $main_basedir/all_statuses/$instance/*/$file_func 2>/dev/null)
|
||||
if [ -n "$statuses_file_action" ]; then
|
||||
dir_status=$(dirname "$statuses_file_action")
|
||||
|
@ -845,6 +845,12 @@ if [ "$daemon_mode" = 'yes' ]; then
|
|||
thread_api_statuses "$status_id" | ./utils/thread_statuses.sh
|
||||
rm "$statuses_file_action"
|
||||
;;
|
||||
'prev')
|
||||
timeline="$(cat "$statuses_file_action" | tr -d '\n')"
|
||||
export instance timeline
|
||||
timeline_api "$status_id" | ./utils/statuses2files.sh
|
||||
rm "$statuses_file_action"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
write_status_action=$(/bin/ls $main_basedir/all_statuses/$instance/create 2>/dev/null)
|
||||
|
|
|
@ -12,7 +12,7 @@ for i in $ids; do
|
|||
if [ -f "$main_basedir"/all_statuses/$instance/$i/$i.json ]; then
|
||||
ids=$(echo "$ids" | sed -E "s/.?$i.?//g")
|
||||
continue
|
||||
elif [ -n "$(7z e -so $main_basedir/archives/$instance.7z $i | cat)" ]; then
|
||||
elif [ -n "$(unzip -p $main_basedir/archives/$instance.zip "**/$i.json")" ]; then
|
||||
ids=$(echo "$ids" | sed -E "s/.?$i.?//g")
|
||||
continue
|
||||
elif [ -d "$main_basedir"/all_statuses/$instance/$i ]; then
|
||||
|
|
|
@ -7,7 +7,9 @@ for i in "$main_basedir"/all_statuses/$instance/*; do
|
|||
|
||||
old_check=$(date +'%s' -r "$i"/*.json)
|
||||
if [ $old_check -lt $unixtime_offset ]; then
|
||||
7z a -sdel "$main_basedir"/archives/$instance.7z $i
|
||||
zip -r -m -u -X "$main_basedir"/archives/$instance.zip $i
|
||||
echo "[Archiver] Olded status $i $(date -d "@$old_check") moved to archive"
|
||||
fi
|
||||
done
|
||||
|
||||
find "$main_basedir"/all_statuses/$instance -type d -empty -exec rmdir {} + # Fix not removed empty folder after move (zip bug)
|
||||
|
|
Loading…
Reference in a new issue