EOF
}
-load_libraries()
-{
- [ -n "$LIBS" ] \
- || errlog "missing LIBS" \
- || return $?
- [ -f "$LIBS/voribs.sh" ] \
- || errlog "library vorbis.sh not found" \
- || return $?
- [ -f "$LIBS/mp3.sh" ] \
- || errlog "library mp3.sh not found" \
- || return $?
- [ -f "$LIBS/opus.sh" ] \
- || errlog "library opus.sh not found" \
- || return $?
- [ -f "$LIBS/flac.sh" ] \
- || errlog "library flac.sh not found" \
- || return $?
-
- source "$LIBS/voribs.sh" || return $?
- source "$LIBS/mp3.sh" || return $?
- source "$LIBS/opus.sh" || return $?
- source "$LIBS/flac.sh" || return $?
-}
-
cleanup_flac()
{
local workdir="$1"
|| return $?
case "$format" in
- "mp3") convert_flac_to_mp3 "$workdir" ;;
- "flac") picture_to_flac "$workdir" ;;
- "opus") convert_flac_to_opus "$workdir" ;;
- *) convert_flac_to_ogg "$workdir" ;;
+ "mp3")
+ [ -f "$LIBS/mp3.sh" ] \
+ || errlog "file $LIBS/mp3.sh does not exists" \
+ || return $?
+ source "$LIBS/mp3.sh" || return $?
+ convert_flac_to_mp3 "$workdir" || return $?
+ ;;
+ "flac")
+ [ -f "$LIBS/flac.sh" ] \
+ || errlog "file $LIBS/mp3.sh does not exists" \
+ || return $?
+ source "$LIBS/flac.sh" || return $?
+ picture_to_flac "$workdir"
+ ;;
+ "opus")
+ [ -f "$LIBS/opus.sh" ] \
+ || errlog "file $LIBS/mp3.sh does not exists" \
+ || return $?
+ source "$LIBS/opus.sh" || return $?
+ convert_flac_to_opus "$workdir"
+ ;;
+ *)
+ [ -f "$LIBS/voribs.sh" ] \
+ || errlog "file $LIBS/mp3.sh does not exists" \
+ || return $?
+ source "$LIBS/voribs.sh" || return $?
+ convert_flac_to_ogg "$workdir" || return $?
+ ;;
esac
cleanup_cover "$workdir"
check_programms || return $?
load_config || return $?
- load_libraries || return $?
[ -n "$MUSICPATH" ] \
|| errlog "missing MUSICPATH" \
|| return $?
+ [ -n "$LIBS" ] \
+ || errlog "missing LIBS" \
+ || return $?
cover=false