better loop, update tag cache
This commit is contained in:
parent
db3a30e54d
commit
69b63c3d48
55
atom
55
atom
@ -799,23 +799,52 @@ echo '
|
||||
AND mime_type_actions.action = 1;
|
||||
|
||||
SELECT "AtOM:NoMoreFiles";' >&3
|
||||
while read -u4 line
|
||||
read -u4 line
|
||||
while ! [[ $line = AtOM:NoMoreFiles ]]
|
||||
do
|
||||
if [[ $line = AtOM:NoMoreFiles ]]
|
||||
tagfiles+=("$line")
|
||||
read -u4 line
|
||||
done
|
||||
echo 'BEGIN TRANSACTION;' >&3
|
||||
for line in "${tagfiles[@]}"
|
||||
do
|
||||
sourcefileid=${line%%|*}
|
||||
rest=${line#*|}
|
||||
lastchange=${rest%%|*}
|
||||
rest=${rest#*|}
|
||||
mimetype=${rest%%|*}
|
||||
filename=${rest#*|}
|
||||
echo -en "\rTags: $((++count*100/filecount))%"
|
||||
if getTags
|
||||
then
|
||||
echo -e "\r$count files to create or update."
|
||||
break
|
||||
else
|
||||
destination=${line%%|*}
|
||||
rest=${line#*|}
|
||||
mimetype=${rest%%|*}
|
||||
filename=${rest#*|}
|
||||
echo -en "\rTags: $((++count*100/filecount))%"
|
||||
getTags
|
||||
#createTask
|
||||
Update tags \
|
||||
album "$album" \
|
||||
albumartist "$albumartist" \
|
||||
artist "$artist" \
|
||||
composer "$composer" \
|
||||
disc "$disc" \
|
||||
genre "$genre" \
|
||||
performer "$performer" \
|
||||
title "$title" \
|
||||
track "$tracknum" \
|
||||
year "$year" \
|
||||
last_change "$lastchange" \
|
||||
>/dev/null <<<"source_file $sourcefileid"
|
||||
unset genre \
|
||||
albumartist \
|
||||
year \
|
||||
album \
|
||||
disc \
|
||||
artist \
|
||||
track \
|
||||
title \
|
||||
composer \
|
||||
performer
|
||||
fi
|
||||
done
|
||||
unset count
|
||||
echo 'COMMIT;' >&3
|
||||
echo -e "\rRead tags from $count files."
|
||||
unset count tagfiles
|
||||
closeDatabase
|
||||
|
||||
# vim:set ts=8 sw=8:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user