- 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

@@ -37,14 +37,15 @@
# Global Variables
#-----------------------------------------------------------------------------------------------------------------------------------
declare -g VERSION="1.1.0"
declare -g NAME="album_seekpoint"
declare -g VERSION="1.1.3"
declare -g NAME="Album_SeekPoint"
declare -g HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] <source_dir> <target_dir> <seek_point_delay>"
declare -g SOURCE_DIR=""
declare -g TARGET_DIR=""
declare -g SEEK_POINT_DELAY=""
declare -g EXIT_CODE=0
declare -g MODE="DEFAULT"
declare -g VERBOSE="FALSE"
declare -g DRY_RUN="FALSE"
@@ -72,7 +73,6 @@ as_version_print()
as_help_print()
{
as_version_print
help_print
}
@@ -105,8 +105,8 @@ as_args_parse()
# Mode switches
-T|--test) MODE="TEST"; shift;;
-h|--help) MODE="EXIT"; as_help_print; shift;;
-V|--version) MODE="EXIT"; as_version_print; shift;;
-h|--help) MODE="HELP"; shift;;
-V|--version) MODE="VERSION"; shift;;
# Global options
-v|--verbose) VERBOSE="TRUE"; shift;;
@@ -117,7 +117,7 @@ as_args_parse()
esac
done
if [[ "${MODE}" != "EXIT" ]]
if [[ "${MODE}" == "DEFAULT" ]]
then
if [[ "${#}" != "3" ]]
then
@@ -128,8 +128,8 @@ as_args_parse()
echo_error "Too many args!"
fi
MODE="EXIT"
as_help_print
MODE="HELP"
EXIT_CODE=1
else
SOURCE_DIR="$1"
TARGET_DIR="$2"
@@ -146,39 +146,55 @@ as_args_parse()
# Main
#-----------------------------------------------------------------------------------------------------------------------------------
vsl_add
as_args_parse "$@"
if [[ "${MODE}" == "EXIT" ]]
then
exit 0
else
if [[ "${MODE}" == "TEST" ]]
then
case "${MODE}" in
"EXIT")
exit ${EXIT_CODE}
;;
"HELP")
as_help_print
exit ${EXIT_CODE}
;;
"TEST")
DRY_RUN="TRUE"
fi
fi
;;
"VERSION")
as_version_print
exit ${EXIT_CODE}
;;
esac
echo_error "${NAME}: Mode: [${MODE}] Verbose: [${VERBOSE}] Source_Dir: [${SOURCE_DIR}] Target_Dir: [${TARGET_DIR}] Seek_Point_Delay: [${SEEK_POINT_DELAY}]"
if [[ ! -d "${TARGET_DIR}" ]]
then
echo_error "Target directory doesn't exist!"
exit -1
EXIT_CODE=1
else
for file in "${SOURCE_DIR}"/*@(.flac)
do
id="$(basename "${file}" | sed -e "s/-.*//")"
target_file="${TARGET_DIR}/$(basename "${file}")"
if [[ "${file}" != "${target_file}" ]]
then
cmd_exec cp "${file}" "${target_file}"
fi
cmd_exec metaflac --remove --block-type=SEEKTABLE "${target_file}"
cmd_exec metaflac --add-seekpoint "${SEEK_POINT_DELAY}s" "${target_file}"
done
fi
for file in "${SOURCE_DIR}"/*@(.flac)
do
id="$(basename "${file}" | sed -e "s/-.*//")"
target_file="${TARGET_DIR}/$(basename "${file}")"
if [[ "${file}" != "${target_file}" ]]
then
cmd_exec cp "${file}" "${target_file}"
fi
cmd_exec metaflac --remove --block-type=SEEKTABLE "${target_file}"
cmd_exec metaflac --add-seekpoint "${SEEK_POINT_DELAY}s" "${target_file}"
done
exit ${EXIT_CODE}