small fixes

This commit is contained in:
Vincent Riquer 2025-11-10 00:52:23 +01:00
parent 66bdede3e8
commit 77db837c39
4 changed files with 17 additions and 16 deletions

20
atom
View File

@ -266,7 +266,7 @@ echo 'COMMIT;' >&3
(( cron )) || echo -n $'\r' (( cron )) || echo -n $'\r'
echo -n "${deleted+$deleted files deleted${removed:+, }}${removed:+$removed removed from database}" echo -n "${deleted+$deleted files deleted${removed:+, }}${removed:+$removed removed from database}"
(( cron )) || echo -ne "\033[K" (( cron )) || echo -ne "\033[K"
echo (( deleted || removed )) && echo
unset removecount deleted removed removefile unset removecount deleted removed removefile
updateTags updateTags
@ -592,11 +592,12 @@ do
if (( timestamp - concurrencychange >= loadinterval )) if (( timestamp - concurrencychange >= loadinterval ))
then then
if (( concurrency > 1 || allow_zero_running )) \ if (( concurrency > 1 || allow_zero_running )) \
&& (( load > maxload && concurrency > 0 )) && (( load > maxload && concurrency ))
then then
concurrencychange=$timestamp concurrencychange=$timestamp
(( --concurrency )) (( --concurrency ))
elif (( load < maxload )) && (( active > concurrency - 1 )) elif (( load < maxload )) \
&& (( active > concurrency - 1 ))
then then
concurrencychange=$timestamp concurrencychange=$timestamp
(( ++concurrency )) (( ++concurrency ))
@ -645,7 +646,7 @@ do
fmtprogress="T:%${#taskcount}i/%i (F:%i) %3i%%" fmtprogress="T:%${#taskcount}i/%i (F:%i) %3i%%"
fmttime='%2id %2ih%02im%02is (A:%4.1fs/task)' fmttime='%2id %2ih%02im%02is (A:%4.1fs/task)'
eta="ETA:$( eta="ETA:$(
printf "%(%c)T" "$(( currenttime + secsremaining )) printf "%(%c)T" "$(( currenttime + secsremaining ))"
)" )"
(( cron )) || printf \ (( cron )) || printf \
"\r$fmtload $fmtworkers $fmtprogress $fmttime $eta\033[K"\ "\r$fmtload $fmtworkers $fmtprogress $fmttime $eta\033[K"\
@ -662,7 +663,7 @@ do
${minutes:-0} \ ${minutes:-0} \
${seconds:-0} \ ${seconds:-0} \
${avgdsec:-0}.${avgdmsec:-0} ${avgdsec:-0}.${avgdmsec:-0}
if ! (( concurrency )) if ! (( concurrency )) && ! (( cron ))
then then
if (( active )) if (( active ))
then then
@ -710,7 +711,8 @@ endtime=$EPOCHSECONDS
${minutes:+$minutes minutes and} \ ${minutes:+$minutes minutes and} \
$seconds seconds." $seconds seconds."
(( cron )) || echo -en "\033[K" (( cron )) || echo -en "\033[K"
echo (( ran )) && echo
if (( failed )) if (( failed ))
then then
echo $'\nFailed tasks:\n' echo $'\nFailed tasks:\n'
@ -926,7 +928,7 @@ do
(( changedcount )) \ (( changedcount )) \
&& echo -n "$destination: Renamed $changedcount files" && echo -n "$destination: Renamed $changedcount files"
(( cron )) || echo -en "\033[K" (( cron )) || echo -en "\033[K"
echo (( changedcount )) && echo
fi fi
unset count changedcount renamefiles unset count changedcount renamefiles
done done
@ -977,9 +979,9 @@ echo 'COMMIT;' >&3
(( count )) \ (( count )) \
&& echo -n "Removed $count obsolete files." && echo -n "Removed $count obsolete files."
(( cron )) || echo -en "\033[K" (( cron )) || echo -en "\033[K"
echo (( count )) && echo
echo "Purging empty directories..." (( debug )) && echo "Purging empty directories..."
for path in "${destinationpath[@]}" for path in "${destinationpath[@]}"
do do
find "$path" -type d -empty -delete find "$path" -type d -empty -delete

View File

@ -112,8 +112,6 @@ copyFiles_action() {
if (( count )) if (( count ))
then then
(( cron )) || echo -n $'\r' (( cron )) || echo -n $'\r'
if (( count ))
then
echo -n "Copied ${done:-0} of $count" \ echo -n "Copied ${done:-0} of $count" \
"files${postponed+ ($postponed postponed)}." "files${postponed+ ($postponed postponed)}."
(( cron )) || echo -en "\033[K" (( cron )) || echo -en "\033[K"

View File

@ -71,5 +71,6 @@ getFiles() {
then then
echo "$count files found${new:+, $new new or changed}." \ echo "$count files found${new:+, $new new or changed}." \
$'\033[K' $'\033[K'
fi
unset count unset count
} }

View File

@ -207,7 +207,7 @@ echo '
echo 'COMMIT;' >&3 echo 'COMMIT;' >&3
(( cron )) || echo -n $'\r' (( cron )) || echo -n $'\r'
(( count )) && echo -n "Read tags from $count files." (( count )) && echo -n "Read tags from $count files."
(( cron )) || echo -n '\033[K' (( cron )) || echo -n $'\033[K'
echo (( count )) && echo
unset count tagfiles unset count tagfiles
} }