Compare commits
6 Commits
03bbd70947
...
76bad8af0b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76bad8af0b | ||
|
|
1fe4099350 | ||
|
|
e0c3aea43c | ||
|
|
3624e50416 | ||
|
|
36dd9d43dd | ||
|
|
f8bb5377ae |
@ -91,9 +91,10 @@ copyFiles_action() {
|
|||||||
"$sourcepath/$sourcefilename" \
|
"$sourcepath/$sourcefilename" \
|
||||||
"$destdir"
|
"$destdir"
|
||||||
then
|
then
|
||||||
|
destfilename=${sourcefilename//$'\n'/::AtOM:NewLine:SQL:Inline::}
|
||||||
Update destination_files \
|
Update destination_files \
|
||||||
filename \
|
filename \
|
||||||
"$destdir/${sourcefilename##*/}"\
|
"$destdir/${destfilename##*/}"\
|
||||||
rename_pattern \
|
rename_pattern \
|
||||||
"${destinationrenamepath[$destination]}/${destinationrename[$destination]}"\
|
"${destinationrenamepath[$destination]}/${destinationrename[$destination]}"\
|
||||||
fat32compat \
|
fat32compat \
|
||||||
|
|||||||
@ -26,6 +26,7 @@ Insert() {
|
|||||||
insert_values+=$value
|
insert_values+=$value
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
value=${value//::AtOM:NewLine:SQL:Inline::/$'\n'}
|
||||||
insert_values+='"'"${value//\"/\"\"}"'"'
|
insert_values+='"'"${value//\"/\"\"}"'"'
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@ -19,6 +19,7 @@ Select() {
|
|||||||
while read key operator value
|
while read key operator value
|
||||||
do
|
do
|
||||||
(( ${#where_statement} )) && where_statement+=( "AND" )
|
(( ${#where_statement} )) && where_statement+=( "AND" )
|
||||||
|
value=${value//::AtOM:NewLine:SQL:Inline::/$'\n'}
|
||||||
where_statement+=( "$key $operator "'"'"${value//\"/\"\"}"'"' )
|
where_statement+=( "$key $operator "'"'"${value//\"/\"\"}"'"' )
|
||||||
done
|
done
|
||||||
echo "SELECT IFNULL(" \
|
echo "SELECT IFNULL(" \
|
||||||
|
|||||||
@ -2,5 +2,5 @@
|
|||||||
decodeMpcdec() {
|
decodeMpcdec() {
|
||||||
tmpfile="${fileid}mpcdec"
|
tmpfile="${fileid}mpcdec"
|
||||||
commandline=(${ionice}mpcdec)
|
commandline=(${ionice}mpcdec)
|
||||||
commandline+=("$sourcepath/$filename" "$tempdir/$tmpfile.wav")
|
commandline+=("$sourcepath/${filename//$'\n'/::AtOM:NewLine:SQL:Inline::}" "$tempdir/$tmpfile.wav")
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,5 +2,5 @@
|
|||||||
decodeOpusdec() {
|
decodeOpusdec() {
|
||||||
tmpfile="${fileid}opusdec"
|
tmpfile="${fileid}opusdec"
|
||||||
commandline=(${ionice}opusdec)
|
commandline=(${ionice}opusdec)
|
||||||
commandline+=("$sourcepath/$filename" "$tempdir/$tmpfile.wav")
|
commandline+=("$sourcepath/${filename//$'\n'/::AtOM:NewLine:SQL:Inline::}" "$tempdir/$tmpfile.wav")
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,7 @@ decodeSox() {
|
|||||||
then
|
then
|
||||||
commandline+=("$1")
|
commandline+=("$1")
|
||||||
else
|
else
|
||||||
commandline+=("$sourcepath/$filename")
|
commandline+=("$sourcepath/${filename//$'\n'/::AtOM:NewLine:SQL:Inline::}")
|
||||||
fi
|
fi
|
||||||
if [ -n "${destinationfrequency["$destination"]}" ] \
|
if [ -n "${destinationfrequency["$destination"]}" ] \
|
||||||
&& (( ${rate:-0} != ${destinationfrequency["$destination"]} ))
|
&& (( ${rate:-0} != ${destinationfrequency["$destination"]} ))
|
||||||
|
|||||||
@ -103,4 +103,5 @@ getDestDir() {
|
|||||||
mkdir -p "${destinationpath[$destination]}/$destdir"
|
mkdir -p "${destinationpath[$destination]}/$destdir"
|
||||||
fi
|
fi
|
||||||
destdir="${destdir//+(\/)//}"
|
destdir="${destdir//+(\/)//}"
|
||||||
|
destdir=${destdir//$'\n'/::AtOM:NewLine:SQL:Inline::}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,6 +55,7 @@ getDestFile() {
|
|||||||
destfile="${filename##*/}"
|
destfile="${filename##*/}"
|
||||||
destfile="${destfile%.*}"
|
destfile="${destfile%.*}"
|
||||||
fi
|
fi
|
||||||
|
destfile=${destfile//$'\n'/::AtOM:NewLine:SQL:Inline::}
|
||||||
if (( ${destinationascii["$destination"]} ))
|
if (( ${destinationascii["$destination"]} ))
|
||||||
then
|
then
|
||||||
echo "$destfile" >&${toascii[1]}
|
echo "$destfile" >&${toascii[1]}
|
||||||
|
|||||||
@ -17,7 +17,7 @@ getFiles() {
|
|||||||
compare_time=$time
|
compare_time=$time
|
||||||
fi
|
fi
|
||||||
if ! Select source_files id >/dev/null <<-EOWhere
|
if ! Select source_files id >/dev/null <<-EOWhere
|
||||||
filename = $filename
|
filename = ${filename//$'\n'/::AtOM:NewLine:SQL:Inline::}
|
||||||
mime_type > 0
|
mime_type > 0
|
||||||
last_change LIKE $compare_time
|
last_change LIKE $compare_time
|
||||||
size = $size
|
size = $size
|
||||||
@ -47,7 +47,7 @@ getFiles() {
|
|||||||
mime_type $mimetypeid \
|
mime_type $mimetypeid \
|
||||||
>/dev/null \
|
>/dev/null \
|
||||||
<<-EOWhere
|
<<-EOWhere
|
||||||
filename $filename
|
filename ${filename//$'\n'/::AtOM:NewLine:SQL:Inline::}
|
||||||
EOWhere
|
EOWhere
|
||||||
(( ++new ))
|
(( ++new ))
|
||||||
if (( new % 1000 == 0 ))
|
if (( new % 1000 == 0 ))
|
||||||
@ -58,7 +58,7 @@ getFiles() {
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
Update source_files last_seen $scantime <<-EOWhere
|
Update source_files last_seen $scantime <<-EOWhere
|
||||||
filename = $filename
|
filename = ${filename//$'\n'/::AtOM:NewLine:SQL:Inline::}
|
||||||
EOWhere
|
EOWhere
|
||||||
fi
|
fi
|
||||||
progressSpin
|
progressSpin
|
||||||
|
|||||||
@ -65,6 +65,7 @@ getConfig
|
|||||||
sanityCheck
|
sanityCheck
|
||||||
openDatabase
|
openDatabase
|
||||||
|
|
||||||
|
echo -n "Checking for missing files... "
|
||||||
echo '
|
echo '
|
||||||
SELECT
|
SELECT
|
||||||
destination_files.id,
|
destination_files.id,
|
||||||
@ -87,12 +88,11 @@ do
|
|||||||
destination_names[id]=${rest%%::AtOM:SQL:Sep::*}
|
destination_names[id]=${rest%%::AtOM:SQL:Sep::*}
|
||||||
rest=${rest#*::AtOM:SQL:Sep::}
|
rest=${rest#*::AtOM:SQL:Sep::}
|
||||||
files[id]=${rest}
|
files[id]=${rest}
|
||||||
read -u4 line
|
read -u4 -r -d $'\0' line
|
||||||
done
|
done
|
||||||
|
|
||||||
echo 'BEGIN TRANSACTION;' >&3
|
echo 'BEGIN TRANSACTION;' >&3
|
||||||
|
|
||||||
echo -n "Checking for missing files... "
|
|
||||||
for index in "${!files[@]}"
|
for index in "${!files[@]}"
|
||||||
do
|
do
|
||||||
destination=${destination_names[index]}
|
destination=${destination_names[index]}
|
||||||
|
|||||||
@ -65,25 +65,22 @@ getConfig
|
|||||||
sanityCheck
|
sanityCheck
|
||||||
openDatabase
|
openDatabase
|
||||||
|
|
||||||
checkwanted() {
|
|
||||||
Select id <<<"filename = $1"
|
|
||||||
}
|
|
||||||
|
|
||||||
for destination in "${!destinationpath[@]}"
|
for destination in "${!destinationpath[@]}"
|
||||||
do
|
do
|
||||||
echo -ne "\rScanning destination $destination... \033[K"
|
echo -ne "\rScanning destination $destination... \033[K"
|
||||||
while read -r filename
|
while read -r -d $'\0' filename
|
||||||
do
|
do
|
||||||
|
sqlfile=${filename//$'\n'/::AtOM:NewLine:SQL:Inline::}
|
||||||
if ! Select destination_files id \
|
if ! Select destination_files id \
|
||||||
>/dev/null \
|
>/dev/null \
|
||||||
<<<"filename = ${filename#${destinationpath["$destination"]}/}"
|
<<<"filename = ${sqlfile#${destinationpath["$destination"]}/}"
|
||||||
then
|
then
|
||||||
echo -e $'\r'"$filename\033[K"
|
echo -e $'\r'"$filename\033[K"
|
||||||
(( remove )) && rm -f "$filename"
|
(( remove )) && rm "$filename"
|
||||||
echo -n "Scanning destination $destination... "
|
echo -n "Scanning destination $destination... "
|
||||||
fi
|
fi
|
||||||
progressSpin
|
progressSpin
|
||||||
done < <(find "${destinationpath["$destination"]}" -type f)
|
done < <(find "${destinationpath["$destination"]}" -type f -print0)
|
||||||
done
|
done
|
||||||
echo -en "\r\033[K"
|
echo -en "\r\033[K"
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user