Merge branch 'master' into toys

This commit is contained in:
Vincent Riquer 2013-05-16 15:55:22 +02:00
commit 59dc0b1a54
10 changed files with 61 additions and 18 deletions

2
atom
View File

@ -616,7 +616,7 @@ do
rest=${line#*::AtOM:SQL:Sep::} rest=${line#*::AtOM:SQL:Sep::}
filename=${rest%%::AtOM:SQL:Sep::*} filename=${rest%%::AtOM:SQL:Sep::*}
oldfilename=${rest#*::AtOM:SQL:Sep::} oldfilename=${rest#*::AtOM:SQL:Sep::}
if [[ $oldfilename != $filename ]] && [ -f "$oldfilename" ] if [[ $oldfilename != "$filename" ]] && [ -f "$oldfilename" ]
then then
rm -f "$oldfilename" rm -f "$oldfilename"
fi fi

View File

@ -51,7 +51,12 @@ encodeFile::mp3() {
$( $(
for key in ${!lameopts[@]} for key in ${!lameopts[@]}
do do
echo "cmd_arg$key ${lameopts[key]}" cleanedopts="${lameopts[key]//\&/\\\&}"
cleanedopts="${cleanedopts//\[/\\[}"
cleanedopts="${cleanedopts//\]/\\]}"
cleanedopts="${cleanedopts//\{/\\{}"
cleanedopts="${cleanedopts//\}/\\\}}"
echo "cmd_arg$key $cleanedopts"
done done
) )
cleanup $tempdir/$tmpfile.wav cleanup $tempdir/$tmpfile.wav

View File

@ -26,7 +26,12 @@ encodeFile::opus() {
$( $(
for key in ${!opusencopts[@]} for key in ${!opusencopts[@]}
do do
echo "cmd_arg$key ${opusencopts[key]}" cleanedopts="${opusencopts[key]//\&/\\\&}"
cleanedopts="${cleanedopts//\[/\\[}"
cleanedopts="${cleanedopts//\]/\\]}"
cleanedopts="${cleanedopts//\{/\\{}"
cleanedopts="${cleanedopts//\}/\\\}}"
echo "cmd_arg$key $cleanedopts"
done done
) )
cleanup $tempdir/$tmpfile.wav cleanup $tempdir/$tmpfile.wav

View File

@ -22,6 +22,11 @@ encodeFile::vorbis() {
$( $(
for key in ${!oggencopts[@]} for key in ${!oggencopts[@]}
do do
cleanedopts="${oggencopts[key]//\&/\\\&}"
cleanedopts="${cleanedopts//\[/\\[}"
cleanedopts="${cleanedopts//\]/\\]}"
cleanedopts="${cleanedopts//\{/\\{}"
cleanedopts="${cleanedopts//\}/\\\}}"
echo "cmd_arg$key ${oggencopts[key]}" echo "cmd_arg$key ${oggencopts[key]}"
done done
) )

View File

@ -19,7 +19,7 @@ getFiles() {
mimetype=$(file -b --mime-type "$sourcepath/$filename") mimetype=$(file -b --mime-type "$sourcepath/$filename")
if [[ $mimetype == application/ogg ]] if [[ $mimetype == application/ogg ]]
then then
case "$(head -n1 "$sourcepath/$filename")" in case "$(head -n5 "$sourcepath/$filename")" in
*'vorbis'*) *'vorbis'*)
mimetype+=' vorbis' mimetype+=' vorbis'
;; ;;

View File

@ -27,12 +27,5 @@ sanitizeFile() {
string=${string/%+(.)/} string=${string/%+(.)/}
fi fi
fi fi
# Not exactly filename sanitity, but these will make the script fail in
# a decorative way..
string="${string//&/\\&}"
strint="${string//;/\\;}"
# And these would exhibit strange behaviors
string="${string//\[/\\\[}"
string="${string//\]/\\\]}"
echo "$string" echo "$string"
} }

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
getInfosOgg_version='Ogg-1' getInfosOgg_version='Ogg-2'
tagreaders+=( "$getInfosOgg_version" ) tagreaders+=( "$getInfosOgg_version" )
getInfos::Ogg() { getInfos::Ogg() {
tagreader="$getInfosOgg_version" tagreader="$getInfosOgg_version"
@ -22,9 +22,9 @@ getInfos::Ogg() {
tracknum="$tracknum/$tracktotal" tracknum="$tracknum/$tracktotal"
fi fi
year=$(gettag date) year=$(gettag date)
infos="${infos/: /=}" infos="${infos//: /=}"
rate=$(gettag rate|head -n1) rate=$(gettag rate|head -n1)
channels=$(gettag channels|head -n1) channels=$(gettag channels|head -n1)
bitrate=$(gettag 'nominal bitrate') bitrate=$(gettag 'average bitrate')
bitrate=${bitrate%%,*} bitrate=${bitrate%%,*}
} }

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
getInfosOpus_version='Opus-1' getInfosOpus_version='Opus-2'
tagreaders+=( "$getInfosOpus_version" ) tagreaders+=( "$getInfosOpus_version" )
getInfos::Opus() { getInfos::Opus() {
tagreader="$getInfosOpus_version" tagreader="$getInfosOpus_version"
@ -22,7 +22,7 @@ getInfos::Opus() {
tracknum="$tracknum/$tracktotal" tracknum="$tracknum/$tracktotal"
fi fi
year=$(gettag date) year=$(gettag date)
infos="${infos/: /=}" infos="${infos//: /=}"
rate=$(gettag 'original sample rate'|head -n1) rate=$(gettag 'original sample rate'|head -n1)
channels=$(gettag channels|head -n1) channels=$(gettag channels|head -n1)
bitrate=$(gettag 'average bitrate') bitrate=$(gettag 'average bitrate')

View File

@ -1,3 +1,37 @@
createindex
===========
Creates a nice index of your collection, similar to what oidua
(http://oidua.suxbad.com/) does, but much faster, as it is using AtOM's DB
instead of rescanning your whole collection.
Options define what will be shown and may optionnally be followed by the column
width (default: 50).
Options:
-f: Path
-b: Average bitrate
-C: Channels
-s: Sample rate
-m: Mofification time
-M: Format
-A: Album artist
-l: Album
-a: Artist
-c: Composer
-d: Disc
-g: Genre
-p: Performer
-t: Title
-y: Year
-T <format>: date-time format (see 'man date' for possible values)
-o -|<file>: output file (path relative to Source) - mandatory - must
appear last.
-u: update database first
-D: debug
checkextensions checkextensions
=============== ===============
Reports files whose extension does not match the (detected) mime-type. Reports files whose extension does not match the (detected) mime-type.

View File

@ -82,7 +82,8 @@ done
-b Average bitrate -b Average bitrate
-C Channels -C Channels
-s Sample rate -s Sample rate
-T Mofification time -m Mofification time
-M Format
-A Album artist -A Album artist
-l Album -l Album
@ -94,7 +95,7 @@ done
-t Title -t Title
-y Year -y Year
-d <format>: date-time format (see 'man date' for possible values) -T <format>: date-time format (see 'man date' for possible values)
-o <file> : output file (path relative to Source) -o <file> : output file (path relative to Source)
-u : update database first -u : update database first