- Add VSL support,

- Support now rx3-base 1.2.0.
This commit is contained in:
2026-09-13 12:14:25 +02:00
parent 2298881174
commit 7cbd0dc0c9
16 changed files with 688 additions and 472 deletions

View File

@@ -39,12 +39,13 @@
# Global Variables
#-----------------------------------------------------------------------------------------------------------------------------------
declare -g VERSION="1.1.0"
declare -g NAME="music_check"
declare -g VERSION="1.1.3"
declare -g NAME="Music_Check"
declare -g HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] <source_dir>"
declare -g SOURCE_DIR=""
declare -g EXIT_CODE=0
declare -g MODE="DEFAULT"
declare -g VERBOSE="FALSE"
declare -g DRY_RUN="FALSE"
@@ -72,7 +73,6 @@ mc_version_print()
mc_help_print()
{
mc_version_print
help_print
}
@@ -105,8 +105,8 @@ mc_args_parse()
# Mode switches
-T|--test) MODE="TEST"; shift;;
-h|--help) MODE="EXIT"; mc_help_print; shift;;
-V|--version) MODE="EXIT"; mc_version_print; shift;;
-h|--help) MODE="HELP"; shift;;
-V|--version) MODE="VERSION"; shift;;
# Global options
-v|--verbose) VERBOSE="TRUE"; shift;;
@@ -117,7 +117,7 @@ mc_args_parse()
esac
done
if [[ "${MODE}" != "EXIT" ]]
if [[ "${MODE}" == "DEFAULT" ]]
then
if [[ "${#}" != "1" ]]
then
@@ -128,8 +128,8 @@ mc_args_parse()
echo_error "Too many args!"
fi
MODE="EXIT"
mc_help_print
MODE="HELP"
EXIT_CODE=1
else
SOURCE_DIR="$1"
fi
@@ -144,40 +144,55 @@ mc_args_parse()
# Main
#-----------------------------------------------------------------------------------------------------------------------------------
vsl_add
mc_args_parse "$@"
case "${MODE}" in
"EXIT")
exit ${EXIT_CODE}
;;
"HELP")
mc_help_print
exit ${EXIT_CODE}
;;
if [[ "${MODE}" == "EXIT" ]]
then
exit 0
else
if [[ "${MODE}" == "TEST" ]]
then
"TEST")
DRY_RUN="TRUE"
fi
fi
;;
"VERSION")
mc_version_print
exit ${EXIT_CODE}
;;
esac
echo_error "${NAME}: Mode: [${MODE}] Verbose: [${VERBOSE}] Source_Dir: [${SOURCE_DIR}]"
if [[ ! -d "${SOURCE_DIR}" ]]
then
echo_error "Source directory doesn't exist!"
exit -1
EXIT_CODE=1
else
i=1
find "${SOURCE_DIR}" -name '*.flac' -print0 | sort -z | while IFS= read -r -d '' file
do
echo_line "${file}: " "${i}"
cmd_exec flac --test "${file}" >/dev/null 2>&1
if [[ $? -eq 0 ]]
then
echo "OK"
else
echo "KO"
fi
i=$((i+1))
done
fi
i=1
find "${SOURCE_DIR}" -name '*.flac' -print0 | sort -z | while IFS= read -r -d '' file
do
echo_line "${file}: " "${i}"
cmd_exec flac --test "${file}" >/dev/null 2>&1
if [[ $? -eq 0 ]]
then
echo "OK"
else
echo "KO"
fi
i=$((i+1))
done
exit ${EXIT_CODE}