Merge branch 'enhancements' into 'master'
Bunch of enhacements See merge request ScriptFanix/AtOM!6
This commit is contained in:
commit
cc1c687118
22
atom
22
atom
@ -64,6 +64,7 @@ help() {
|
||||
-c <file> Load configuration file <file>
|
||||
-C Dump configuration and exit
|
||||
-l <load> Override max-load
|
||||
-f <workers> Use exactly <workers> child processes
|
||||
-T <seconds> override load-interval
|
||||
-F <destination> Force re-generation of all files in
|
||||
<destination>
|
||||
@ -77,7 +78,7 @@ help() {
|
||||
|
||||
#parse arguments
|
||||
OPTERR=0
|
||||
while getopts ':c:Cl:T:F:B:ShDq' opt
|
||||
while getopts ':c:Cl:T:F:f:B:ShDq' opt
|
||||
do
|
||||
case $opt in
|
||||
c)
|
||||
@ -95,6 +96,9 @@ do
|
||||
F)
|
||||
forceall+=("$OPTARG")
|
||||
;;
|
||||
f)
|
||||
fixed_workers="$OPTARG"
|
||||
;;
|
||||
B)
|
||||
maxbatch="$OPTARG"
|
||||
;;
|
||||
@ -349,6 +353,7 @@ updateMimes
|
||||
|
||||
removeObsoleteFiles
|
||||
|
||||
(( cron )) || echo -n 'Gathering files for cleaning...'
|
||||
echo '
|
||||
SELECT COUNT(id)
|
||||
FROM destination_files
|
||||
@ -396,7 +401,7 @@ do
|
||||
then
|
||||
echo 'COMMIT;BEGIN TRANSACTION;' >&3
|
||||
fi
|
||||
(( cron )) || echo -en "\rClean obsolete data: $(((deleted+removed)*100/removecount))%"
|
||||
(( cron )) || echo -en "\rClean obsolete data: $(((deleted+removed)*100/removecount))%\033[K"
|
||||
done
|
||||
echo 'COMMIT;' >&3
|
||||
(( cron )) || echo -n $'\r'
|
||||
@ -692,10 +697,21 @@ starttime=$concurrencychange
|
||||
taskcount=$count
|
||||
remaining=$taskcount
|
||||
failed=0
|
||||
echo 'BEGIN TRANSACTION;' >&3
|
||||
committime=$(date +%s)
|
||||
while (( (remaining || ${#workers[@]}) && ! quit ))
|
||||
do
|
||||
if (( $(date +%s) - committime >= 60 ))
|
||||
then
|
||||
echo $'COMMIT;\nBEGIN TRANSACTION;' >&3
|
||||
committime=$(date +%s)
|
||||
fi
|
||||
read humanload garbage < /proc/loadavg
|
||||
load=${humanload%.*}
|
||||
if (( fixed_workers ))
|
||||
then
|
||||
concurrency="$fixed_workers"
|
||||
else
|
||||
if [ -z "$quit" ] \
|
||||
&& (( ! pause )) \
|
||||
&& (( $(date +%s)-concurrencychange >= loadinterval ))
|
||||
@ -711,6 +727,7 @@ do
|
||||
(( ++concurrency ))
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
checkworkers
|
||||
cleaner
|
||||
(( pause )) || master
|
||||
@ -789,6 +806,7 @@ do
|
||||
fi
|
||||
fi
|
||||
done
|
||||
echo 'COMMIT;' >&3
|
||||
unset count
|
||||
|
||||
endtime=$(date +%s)
|
||||
|
||||
@ -22,7 +22,7 @@ encodeFile::opus() {
|
||||
requires ${soxtaskid:-$decodetaskid}
|
||||
required ${soxtaskid:-$decodetaskid}
|
||||
fileid $destfileid
|
||||
filename $destdir/$destfile.ogg
|
||||
filename $destdir/$destfile.opus
|
||||
$(
|
||||
for key in ${!opusencopts[@]}
|
||||
do
|
||||
|
||||
@ -3,7 +3,7 @@ getFiles() {
|
||||
scantime=$(date +%s)
|
||||
for prune_expression in "${skippeddirectories[@]}"
|
||||
do
|
||||
prunes+="-path $sourcepath$prune_expression -prune -o "
|
||||
prunes+=( -path "$sourcepath$prune_expression" -prune -o )
|
||||
done
|
||||
(( cron )) || echo -n "Scanning $sourcepath... "
|
||||
# We probably have thousands of files, don't waste time on disk writes
|
||||
@ -56,10 +56,10 @@ getFiles() {
|
||||
fi
|
||||
progressSpin
|
||||
done < <(
|
||||
find "$sourcepath" $prunes -type f -printf "%T@ %s %P\n"
|
||||
find "$sourcepath" "${prunes[@]}" -type f -not -name '.*' -printf "%T@ %s %P\n"
|
||||
)
|
||||
echo 'COMMIT;' >&3
|
||||
(( cron )) || echo -n $'\r'
|
||||
echo "${count:-0} files found, ${new:=0} new or changed."
|
||||
echo "${count:-0} files found, ${new:=0} new or changed."$'\033[K'
|
||||
unset count
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
getInfosffmpeg_version='ffmpeg-5'
|
||||
getInfosffmpeg_version='ffmpeg-6'
|
||||
tagreaders+=( "$getInfosffmpeg_version" )
|
||||
getInfos::ffmpeg() {
|
||||
tagreader="$getInfosffmpeg_version"
|
||||
@ -8,7 +8,8 @@ getInfos::ffmpeg() {
|
||||
-i "$sourcepath/$filename" 2>&1 \
|
||||
|sed '
|
||||
/^Input/,/.* Audio: /{s/ *: */=/}
|
||||
s/^[[:space:]]*//'
|
||||
s/^[[:space:]]*//
|
||||
s/\0//g'
|
||||
)
|
||||
local metadata=$(
|
||||
echo -e "$allinfos" \
|
||||
|
||||
@ -11,5 +11,15 @@ progressSpin() {
|
||||
30) echo -n $'\b\\' ;;
|
||||
*) ;;
|
||||
esac
|
||||
if ! (( count % 100 ))
|
||||
then
|
||||
echo -n " $count"
|
||||
until (( backspace > ${#count} ))
|
||||
do
|
||||
(( backspace++ ))
|
||||
echo -n $'\b'
|
||||
done
|
||||
unset backspace
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user