Compare commits
No commits in common. "2c5854c835a755d9a60690d83538024dcfdb871c" and "1c7dff9f835646a7b03c7905090b1d4a4b10c0fc" have entirely different histories.
2c5854c835
...
1c7dff9f83
@ -1,88 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# config structures
|
|
||||||
declare -A \
|
|
||||||
destinationchannels \
|
|
||||||
destinationfat32compat \
|
|
||||||
destinationcopymime \
|
|
||||||
destinationformat \
|
|
||||||
destinationfrequency \
|
|
||||||
destinationid \
|
|
||||||
destinationloss \
|
|
||||||
destinationmaxbps \
|
|
||||||
destinationnormalize \
|
|
||||||
destinationpath \
|
|
||||||
destinationquality \
|
|
||||||
destinationrename \
|
|
||||||
destinationnoresample \
|
|
||||||
destinationrenamepath \
|
|
||||||
destinationskipmime \
|
|
||||||
|| {
|
|
||||||
echo "Check your Bash version. You need >= 4.0" >&2
|
|
||||||
exit $EBASHVERS
|
|
||||||
}
|
|
||||||
|
|
||||||
declare -r \
|
|
||||||
DOCDIR=./doc \
|
|
||||||
LIBDIR=./lib \
|
|
||||||
SHAREDIR=./share
|
|
||||||
declare -r \
|
|
||||||
exampleconf=$DOCDIR/example.cfg \
|
|
||||||
schema=$SHAREDIR/schema.sql \
|
|
||||||
\
|
|
||||||
oldIFS="$IFS"
|
|
||||||
|
|
||||||
cffile="$HOME/.atom/atom.cfg"
|
|
||||||
LC_ALL=C
|
|
||||||
|
|
||||||
shopt -s extglob
|
|
||||||
|
|
||||||
for function in "$LIBDIR"/*/*
|
|
||||||
do
|
|
||||||
source "$function"
|
|
||||||
done
|
|
||||||
|
|
||||||
while getopts 'Dr' opt
|
|
||||||
do
|
|
||||||
case $opt in
|
|
||||||
D) (( debug++ )) ;;
|
|
||||||
r) regen=1 ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
getConfig
|
|
||||||
|
|
||||||
openDatabase
|
|
||||||
|
|
||||||
echo 'SELECT id,filename FROM destination_files WHERE filename IS NOT NULL;' >&3
|
|
||||||
echo 'SELECT "AtOM:NoMoreFiles";' >&3
|
|
||||||
|
|
||||||
read -u4 filename
|
|
||||||
until [[ $filename == AtOM:NoMoreFiles ]]
|
|
||||||
do
|
|
||||||
files+=("$filename")
|
|
||||||
read -u4 filename
|
|
||||||
done
|
|
||||||
|
|
||||||
echo 'BEGIN TRANSACTION;' >&3
|
|
||||||
|
|
||||||
echo -n "Checking for missing files... "
|
|
||||||
for filename in "${files[@]}"
|
|
||||||
do
|
|
||||||
id=${filename%%::AtOM:SQL:Sep::*}
|
|
||||||
filename=${filename#*::AtOM:SQL:Sep::}
|
|
||||||
if ! [ -f "$filename" ]
|
|
||||||
then
|
|
||||||
echo -e "\r$filename\033[K"
|
|
||||||
((regen))&&Update destination_files last_change 0 <<<"id = $id"
|
|
||||||
echo -n "Checking for missing files... "
|
|
||||||
(( missing++ ))
|
|
||||||
fi
|
|
||||||
progressSpin
|
|
||||||
done
|
|
||||||
|
|
||||||
echo 'COMMIT;' >&3
|
|
||||||
|
|
||||||
echo -e "\r${missing:-0} missing files\033[K"
|
|
||||||
|
|
||||||
closeDatabase
|
|
||||||
@ -407,13 +407,10 @@ do
|
|||||||
rest="${rest#*::AtOM:SQL:Sep::}"
|
rest="${rest#*::AtOM:SQL:Sep::}"
|
||||||
case $mimetype in
|
case $mimetype in
|
||||||
application/ogg\ opus) type=Opus ;;
|
application/ogg\ opus) type=Opus ;;
|
||||||
audio/ogg\ opus) type=Opus ;;
|
|
||||||
application/ogg\ vorbis) type=Vorbis ;;
|
application/ogg\ vorbis) type=Vorbis ;;
|
||||||
audio/ogg\ vorbis) type=Vorbis ;;
|
|
||||||
audio/mp4) type=MPEG4\ Audio;;
|
audio/mp4) type=MPEG4\ Audio;;
|
||||||
audio/mpeg) type=MPEG\ Audio;;
|
audio/mpeg) type=MPEG\ Audio;;
|
||||||
audio/x-flac) type=FLAC ;;
|
audio/x-flac) type=FLAC ;;
|
||||||
audio/flac) type=FLAC ;;
|
|
||||||
video/mpeg) type=MPEG\ Video;;
|
video/mpeg) type=MPEG\ Video;;
|
||||||
video/webm) type=WebM ;;
|
video/webm) type=WebM ;;
|
||||||
video/x-flv) type=Flash\ Video;;
|
video/x-flv) type=Flash\ Video;;
|
||||||
@ -690,9 +687,9 @@ maxcountlen=${#maxcountlen}
|
|||||||
rest="${line#*::AtOM:SQL:Sep::}::AtOM:SQL:Sep::"
|
rest="${line#*::AtOM:SQL:Sep::}::AtOM:SQL:Sep::"
|
||||||
totalsize="${line%%::AtOM:SQL:Sep::*}"
|
totalsize="${line%%::AtOM:SQL:Sep::*}"
|
||||||
for format in \
|
for format in \
|
||||||
audio/flac \
|
audio/x-flac \
|
||||||
audio/ogg\ vorbis \
|
application/ogg\ vorbis \
|
||||||
audio/ogg\ opus \
|
application/ogg\ opus \
|
||||||
audio/mpeg \
|
audio/mpeg \
|
||||||
audio/mp4 \
|
audio/mp4 \
|
||||||
\
|
\
|
||||||
@ -718,11 +715,11 @@ do
|
|||||||
size="${rest%%::AtOM:SQL:Sep::*}"
|
size="${rest%%::AtOM:SQL:Sep::*}"
|
||||||
(( count )) || continue
|
(( count )) || continue
|
||||||
case $format in
|
case $format in
|
||||||
audio/ogg\ opus) type=Opus ;;
|
application/ogg\ opus) type=Opus ;;
|
||||||
audio/ogg\ vorbis) type=Vorbis ;;
|
application/ogg\ vorbis) type=Vorbis ;;
|
||||||
audio/mp4) type=MPEG4\ Audio ;;
|
audio/mp4) type=MPEG4\ Audio ;;
|
||||||
audio/mpeg) type=MPEG\ Audio ;;
|
audio/mpeg) type=MPEG\ Audio ;;
|
||||||
audio/flac) type=FLAC ;;
|
audio/x-flac) type=FLAC ;;
|
||||||
video/mpeg) type=MPEG\ Video ;;
|
video/mpeg) type=MPEG\ Video ;;
|
||||||
video/webm) type=WebM ;;
|
video/webm) type=WebM ;;
|
||||||
video/x-flv) type=Flash\ Video ;;
|
video/x-flv) type=Flash\ Video ;;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user