Compare commits

...

2 Commits

Author SHA1 Message Date
localhost_frssoft a85d67dab5 replaced 7z to zip 2022-08-07 23:14:19 +03:00
localhost_frssoft a5e6ceb077 Prev listing statuses 2022-08-07 20:35:08 +03:00
3 changed files with 11 additions and 3 deletions

View File

@ -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)

View File

@ -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

View File

@ -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)