Compare commits
No commits in common. "eb459836137d2ca83ed852fcc43a81d2c1f3c1a0" and "b067454799738b132b4ce303d6f21b115958d5b2" have entirely different histories.
eb45983613
...
b067454799
@ -22,11 +22,11 @@ copyFiles_action() {
|
|||||||
AND mime_type_actions.action = 2;
|
AND mime_type_actions.action = 2;
|
||||||
|
|
||||||
SELECT "AtOM:NoMoreFiles";' >&3
|
SELECT "AtOM:NoMoreFiles";' >&3
|
||||||
read -u4 -d$'\0' line
|
read -u4 line
|
||||||
while ! [[ $line = AtOM:NoMoreFiles ]]
|
while ! [[ $line = AtOM:NoMoreFiles ]]
|
||||||
do
|
do
|
||||||
copyfiles+=("$line")
|
copyfiles+=("$line")
|
||||||
read -u4 -d$'\0' line
|
read -u4 line
|
||||||
done
|
done
|
||||||
|
|
||||||
echo 'BEGIN TRANSACTION;' >&3
|
echo 'BEGIN TRANSACTION;' >&3
|
||||||
|
|||||||
@ -21,7 +21,7 @@ guessPath() {
|
|||||||
LIMIT 1
|
LIMIT 1
|
||||||
),"0.0");
|
),"0.0");
|
||||||
'>&3
|
'>&3
|
||||||
read -u4 -d$'\0' timestamp
|
read -u4 timestamp
|
||||||
if (( ${timestamp/./} == 0 ))
|
if (( ${timestamp/./} == 0 ))
|
||||||
then
|
then
|
||||||
return 2
|
return 2
|
||||||
@ -46,7 +46,7 @@ guessPath() {
|
|||||||
LIMIT 1
|
LIMIT 1
|
||||||
),"AtOM:NotFound");
|
),"AtOM:NotFound");
|
||||||
'>&3
|
'>&3
|
||||||
read -u4 -d$'\0' filename
|
read -u4 filename
|
||||||
if [[ $filename != AtOM:NotFound ]]
|
if [[ $filename != AtOM:NotFound ]]
|
||||||
then
|
then
|
||||||
echo "${filename%/*}"
|
echo "${filename%/*}"
|
||||||
|
|||||||
@ -52,12 +52,12 @@ echo '
|
|||||||
;
|
;
|
||||||
|
|
||||||
SELECT "AtOM:NoMoreFiles";' >&3
|
SELECT "AtOM:NoMoreFiles";' >&3
|
||||||
read -u4 -d$'\0' line
|
read -u4 line
|
||||||
while ! [[ $line = AtOM:NoMoreFiles ]]
|
while ! [[ $line = AtOM:NoMoreFiles ]]
|
||||||
do
|
do
|
||||||
tagfiles+=("$line")
|
tagfiles+=("$line")
|
||||||
(( filecount++ ))
|
(( filecount++ ))
|
||||||
read -u4 -d$'\0' line
|
read -u4 line
|
||||||
done
|
done
|
||||||
echo 'BEGIN TRANSACTION;' >&3
|
echo 'BEGIN TRANSACTION;' >&3
|
||||||
for line in "${tagfiles[@]}"
|
for line in "${tagfiles[@]}"
|
||||||
|
|||||||
@ -10,7 +10,7 @@ gettaskinfos() {
|
|||||||
FROM tasks
|
FROM tasks
|
||||||
WHERE id='$1';
|
WHERE id='$1';
|
||||||
' >&3
|
' >&3
|
||||||
read -u4 -d$'\0' line
|
read -u4 line
|
||||||
taskid=${line%%::AtOM:SQL:Sep::*}
|
taskid=${line%%::AtOM:SQL:Sep::*}
|
||||||
rest="${line#*::AtOM:SQL:Sep::}::AtOM:SQL:Sep::"
|
rest="${line#*::AtOM:SQL:Sep::}::AtOM:SQL:Sep::"
|
||||||
sourcefileid=${rest%%::AtOM:SQL:Sep::*}
|
sourcefileid=${rest%%::AtOM:SQL:Sep::*}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
createworker() {
|
createworker() {
|
||||||
(( ++active ))
|
(( ++active ))
|
||||||
read -u4 -d$'\0' line
|
read -u4 line
|
||||||
taskid=${line%%::AtOM:SQL:Sep::*}
|
taskid=${line%%::AtOM:SQL:Sep::*}
|
||||||
rest="${line#*::AtOM:SQL:Sep::}::AtOM:SQL:Sep::"
|
rest="${line#*::AtOM:SQL:Sep::}::AtOM:SQL:Sep::"
|
||||||
sourcefileid=${rest%%::AtOM:SQL:Sep::*}
|
sourcefileid=${rest%%::AtOM:SQL:Sep::*}
|
||||||
|
|||||||
@ -10,7 +10,7 @@ master() {
|
|||||||
WHERE status = 0;
|
WHERE status = 0;
|
||||||
'>&3
|
'>&3
|
||||||
|
|
||||||
read -u4 -d$'\0' remaining
|
read -u4 remaining
|
||||||
if (( remaining == 0 ))
|
if (( remaining == 0 ))
|
||||||
then
|
then
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
@ -108,7 +108,7 @@ master() {
|
|||||||
LIMIT 1;
|
LIMIT 1;
|
||||||
'>&3
|
'>&3
|
||||||
|
|
||||||
read -u4 -d$'\0' ready
|
read -u4 ready
|
||||||
if (( ready > 0 ))
|
if (( ready > 0 ))
|
||||||
then
|
then
|
||||||
createworker
|
createworker
|
||||||
@ -194,7 +194,7 @@ master() {
|
|||||||
LIMIT 1;
|
LIMIT 1;
|
||||||
' >&3
|
' >&3
|
||||||
|
|
||||||
read -u4 -d$'\0' ready
|
read -u4 ready
|
||||||
|
|
||||||
if (( active == 0 && ready == 0 ))
|
if (( active == 0 && ready == 0 ))
|
||||||
then
|
then
|
||||||
@ -234,7 +234,7 @@ master() {
|
|||||||
WHERE status = 0;
|
WHERE status = 0;
|
||||||
'>&3
|
'>&3
|
||||||
|
|
||||||
read -u4 -d$'\0' remaining
|
read -u4 remaining
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@ -121,7 +121,7 @@ getdstfiles() {
|
|||||||
;
|
;
|
||||||
SELECT "AtOM:NoMoreFiles";
|
SELECT "AtOM:NoMoreFiles";
|
||||||
'>&3
|
'>&3
|
||||||
while read -u4 -d$'\0' line
|
while read -u4 line
|
||||||
do
|
do
|
||||||
if [[ $line == AtOM:NoMoreFiles ]]
|
if [[ $line == AtOM:NoMoreFiles ]]
|
||||||
then
|
then
|
||||||
@ -159,7 +159,7 @@ renameFile() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
while read -u4 -d$'\0' line
|
while read -u4 line
|
||||||
do
|
do
|
||||||
if [[ $line == AtOM:NoMoreFiles ]]
|
if [[ $line == AtOM:NoMoreFiles ]]
|
||||||
then
|
then
|
||||||
|
|||||||
@ -79,7 +79,7 @@ echo 'SELECT "AtOM:NoMoreFiles";' >&3
|
|||||||
declare -a \
|
declare -a \
|
||||||
destination_names \
|
destination_names \
|
||||||
files
|
files
|
||||||
read -u4 -d$'\0' line
|
read -u4 line
|
||||||
until [[ $line == AtOM:NoMoreFiles ]]
|
until [[ $line == AtOM:NoMoreFiles ]]
|
||||||
do
|
do
|
||||||
id=${line%%::AtOM:SQL:Sep::*}
|
id=${line%%::AtOM:SQL:Sep::*}
|
||||||
|
|||||||
@ -274,7 +274,7 @@ fi
|
|||||||
echo 'SELECT IFNULL(
|
echo 'SELECT IFNULL(
|
||||||
(SELECT last_seen FROM source_files ORDER BY last_seen DESC LIMIT 1),
|
(SELECT last_seen FROM source_files ORDER BY last_seen DESC LIMIT 1),
|
||||||
0);' >&3
|
0);' >&3
|
||||||
read -u4 -d$'\0' lastupdate
|
read -u4 lastupdate
|
||||||
|
|
||||||
if ! [[ "$output" == - ]]
|
if ! [[ "$output" == - ]]
|
||||||
then
|
then
|
||||||
@ -369,11 +369,11 @@ COLLATE NOCASE;
|
|||||||
|
|
||||||
SELECT "AtOM:NoMoreFiles";' >&3
|
SELECT "AtOM:NoMoreFiles";' >&3
|
||||||
|
|
||||||
read -u4 -d$'\0' line
|
read -u4 line
|
||||||
until [[ $line == AtOM:NoMoreFiles ]]
|
until [[ $line == AtOM:NoMoreFiles ]]
|
||||||
do
|
do
|
||||||
files+=("$line")
|
files+=("$line")
|
||||||
read -u4 -d$'\0' line
|
read -u4 line
|
||||||
done
|
done
|
||||||
|
|
||||||
for line in "${files[@]}"
|
for line in "${files[@]}"
|
||||||
@ -675,7 +675,7 @@ echo '
|
|||||||
|
|
||||||
SELECT "AtOM:NoMoreFiles";' >&3
|
SELECT "AtOM:NoMoreFiles";' >&3
|
||||||
|
|
||||||
read -u4 -d$'\0' line
|
read -u4 line
|
||||||
until [[ $line == AtOM:NoMoreFiles ]]
|
until [[ $line == AtOM:NoMoreFiles ]]
|
||||||
do
|
do
|
||||||
artist="${line%%::AtOM:SQL:Sep::*}"
|
artist="${line%%::AtOM:SQL:Sep::*}"
|
||||||
@ -685,7 +685,7 @@ do
|
|||||||
artists+=( "$artist" )
|
artists+=( "$artist" )
|
||||||
maxcountlen=$(( ${#count} > maxcountlen ? ${#count} : maxcountlen ))
|
maxcountlen=$(( ${#count} > maxcountlen ? ${#count} : maxcountlen ))
|
||||||
maxartistlen=$(( ${#artist} > maxartistlen ? ${#artist} : maxartistlen ))
|
maxartistlen=$(( ${#artist} > maxartistlen ? ${#artist} : maxartistlen ))
|
||||||
read -u4 -d$'\0' line
|
read -u4 line
|
||||||
done
|
done
|
||||||
head=$(
|
head=$(
|
||||||
printf "| # | %'${maxcoutlen}s | %-${maxartistlen}s |" \
|
printf "| # | %'${maxcoutlen}s | %-${maxartistlen}s |" \
|
||||||
@ -714,7 +714,7 @@ echo '
|
|||||||
FROM source_files
|
FROM source_files
|
||||||
INNER JOIN mime_types
|
INNER JOIN mime_types
|
||||||
ON source_files.mime_type=mime_types.id;' >&3
|
ON source_files.mime_type=mime_types.id;' >&3
|
||||||
read -u4 -d$'\0' line
|
read -u4 line
|
||||||
totalcount="${line%%::AtOM:SQL:Sep::*}"
|
totalcount="${line%%::AtOM:SQL:Sep::*}"
|
||||||
maxcountlen=$(printf "%'i" $totalcount)
|
maxcountlen=$(printf "%'i" $totalcount)
|
||||||
maxcountlen=${#maxcountlen}
|
maxcountlen=${#maxcountlen}
|
||||||
@ -743,7 +743,7 @@ do
|
|||||||
INNER JOIN mime_types
|
INNER JOIN mime_types
|
||||||
ON source_files.mime_type=mime_types.id
|
ON source_files.mime_type=mime_types.id
|
||||||
WHERE mime_text LIKE "'"$format"'";' >&3
|
WHERE mime_text LIKE "'"$format"'";' >&3
|
||||||
read -u4 -d$'\0' line
|
read -u4 line
|
||||||
count="${line%%::AtOM:SQL:Sep::*}"
|
count="${line%%::AtOM:SQL:Sep::*}"
|
||||||
rest="${line#*::AtOM:SQL:Sep::}::AtOM:SQL:Sep::"
|
rest="${line#*::AtOM:SQL:Sep::}::AtOM:SQL:Sep::"
|
||||||
size="${rest%%::AtOM:SQL:Sep::*}"
|
size="${rest%%::AtOM:SQL:Sep::*}"
|
||||||
|
|||||||
@ -131,11 +131,11 @@ echo ') ORDER BY bitrate;' >&3
|
|||||||
|
|
||||||
echo 'SELECT "AtOM:NoMoreFiles";' >&3
|
echo 'SELECT "AtOM:NoMoreFiles";' >&3
|
||||||
|
|
||||||
read -u4 -d$'\0' line
|
read -u4 line
|
||||||
until [[ $line == AtOM:NoMoreFiles ]]
|
until [[ $line == AtOM:NoMoreFiles ]]
|
||||||
do
|
do
|
||||||
echo "${line//::AtOM:SQL:Sep::/$'\t'}"
|
echo "${line//::AtOM:SQL:Sep::/$'\t'}"
|
||||||
read -u4 -d$'\0' line
|
read -u4 line
|
||||||
done
|
done
|
||||||
|
|
||||||
closeDatabase
|
closeDatabase
|
||||||
|
|||||||
@ -149,11 +149,11 @@ cat >&3 <<-EOSelect
|
|||||||
SELECT "AtOM:NoMoreFiles";
|
SELECT "AtOM:NoMoreFiles";
|
||||||
EOSelect
|
EOSelect
|
||||||
|
|
||||||
read -u4 -d$'\0' line
|
read -u4 line
|
||||||
until [[ $line == AtOM:NoMoreFiles ]]
|
until [[ $line == AtOM:NoMoreFiles ]]
|
||||||
do
|
do
|
||||||
lines+=( "$line" )
|
lines+=( "$line" )
|
||||||
read -u4 -d$'\0' line
|
read -u4 line
|
||||||
done
|
done
|
||||||
|
|
||||||
for line in "${lines[@]}"
|
for line in "${lines[@]}"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user