2 Commits

Author SHA1 Message Date
cf0548d32d - Add new sh_exec FORCE option to all library non write actions. 2026-05-03 11:34:48 +02:00
66aaffa3a8 - Move usr/lib to lib,
- Support rx3-base 1.1.2,
- Bump release from 1.0.x to 1.1.x.
2026-05-02 18:40:31 +02:00
17 changed files with 56 additions and 33 deletions

View File

@@ -1,4 +1,4 @@
Welcome to Rx3 Music Tools 1.0.x ! Welcome to Rx3 Music Tools 1.1.x !

View File

@@ -1,5 +1,16 @@
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
Music Tools V 1.0.0 - A. GIBERT - 2026/04/12 Music Tools V 1.1.1 - A. GIBERT - 2026/05/03
------------------------------------------------------------------------------------------------------------------------------------
- Move usr/lib to lib,
- Support rx3-base 1.1.2,
- Add new sh_exec FORCE option to all library non write actions,
- Bump release from 1.0.x to 1.1.x.
------------------------------------------------------------------------------------------------------------------------------------
Music Tools V 1.1.0 - A. GIBERT - 2026/04/12
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
- Initial Released version. - Initial Released version.
@@ -7,7 +18,7 @@ Music Tools V 1.0.0 - A. GIBERT - 2026/04/12
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
Music Tools Unreleased - A. GIBERT - 2016-2026 Music Tools V 1.0.0 - A. GIBERT - 2016-2026
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
- Initial unreleased versions. - Initial unreleased versions.

View File

@@ -25,7 +25,7 @@
%define name music_tools %define name music_tools
%define version 1.0.0 %define version 1.1.1
%define release %mkrel 1rx3 %define release %mkrel 1rx3
@@ -51,6 +51,8 @@ Packager: Arnaud G. GIBERT <arnaud@rx3.net>
BuildArch: noarch BuildArch: noarch
Requires: rx3-base-libs
Source0: https://git.rx3.org/gitea/rx3/%{name}/archive/%{name}-%{version}.tar.gz Source0: https://git.rx3.org/gitea/rx3/%{name}/archive/%{name}-%{version}.tar.gz
@@ -94,7 +96,7 @@ cp etc/bash_completion.d/* %{buildroot}%{_sysconfdir}/bash_completi
# Lib # Lib
%{__mkdir_p} %{buildroot}%{_prefix}/lib/rx3 %{__mkdir_p} %{buildroot}%{_prefix}/lib/rx3
cp usr/lib/rx3/*.bash %{buildroot}%{_prefix}/lib/rx3 cp lib/rx3/*.bash %{buildroot}%{_prefix}/lib/rx3
# Bin # Bin
%{__mkdir_p} %{buildroot}%{_bindir} %{__mkdir_p} %{buildroot}%{_bindir}
@@ -125,5 +127,9 @@ cp bin/* %{buildroot}%{_bindir}
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
%changelog %changelog
* Sun Apr 12 2026 Arnaud G. GIBERT <arnaud@rx3.net> - 1.0.0-1rx3.mga9 * Sun May 3 2026 Arnaud G. GIBERT <arnaud@rx3.net> - 1.1.1-1rx3.mga9
- Update to 1.1.1 release
- Add rx3-base-libs depedency
* Sun Apr 12 2026 Arnaud G. GIBERT <arnaud@rx3.net> - 1.1.0-1rx3.mga9
- Initial release - Initial release

View File

@@ -39,7 +39,7 @@
# Global Variables # Global Variables
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
declare -g VERSION="1.0.0" declare -g VERSION="1.1.0"
declare -g NAME="album_convert" declare -g NAME="album_convert"
declare -g HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] [-r | --resample] [-d | --downsampled_tag] <source_dir> <target_dir>" declare -g HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] [-r | --resample] [-d | --downsampled_tag] <source_dir> <target_dir>"
@@ -91,7 +91,7 @@ ac_args_parse()
{ {
tmp_args=$(getopt -o ThVvrd --long test,help,version,verbose,resample,downsampled_tag -n "${NAME}" -- "$@") tmp_args=$(getopt -o ThVvrd --long test,help,version,verbose,resample,downsampled_tag -n "${NAME}" -- "$@")
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi if [ $? != 0 ] ; then echo_error "Terminating..." ; exit 1 ; fi
# Note the quotes around `$TEMP': they are essential! # Note the quotes around `$TEMP': they are essential!
eval set -- "${tmp_args}" eval set -- "${tmp_args}"

View File

@@ -39,7 +39,7 @@
# Global Variables # Global Variables
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
declare -g VERSION="1.0.0" declare -g VERSION="1.1.0"
declare -g NAME="album_merge" declare -g NAME="album_merge"
declare -g HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] <source_dir> <target_dir> <album_name> <prefix>" declare -g HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] <source_dir> <target_dir> <album_name> <prefix>"

View File

@@ -39,7 +39,7 @@
# Global Variables # Global Variables
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
declare -g VERSION="1.0.0" declare -g VERSION="1.1.0"
declare -g NAME="album_metadata_load" declare -g NAME="album_metadata_load"
declare -g HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] [-c | --clean] <Source_Dir> <Target_Dir> <MetaData_File>" declare -g HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] [-c | --clean] <Source_Dir> <Target_Dir> <MetaData_File>"

View File

@@ -39,7 +39,7 @@
# Global Variables # Global Variables
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
declare -g VERSION="1.0.0" declare -g VERSION="1.1.0"
declare -g NAME="album_metadata_save" declare -g NAME="album_metadata_save"
declare -g HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] [-f | --factoring] [-s | --standardising] <Source_Dir> <MetaData_File>" declare -g HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] [-f | --factoring] [-s | --standardising] <Source_Dir> <MetaData_File>"

View File

@@ -39,7 +39,7 @@
# Global Variables # Global Variables
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
declare -g VERSION="1.0.0" declare -g VERSION="1.1.0"
declare -g NAME="album_name_fix " declare -g NAME="album_name_fix "
declare -g HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] [-a <album_dir>] [-p|--music_pattern <music_pattern>] [-s|--sed_substitute_pattern <sed_substitue_pattern>]" declare -g HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] [-a <album_dir>] [-p|--music_pattern <music_pattern>] [-s|--sed_substitute_pattern <sed_substitue_pattern>]"

View File

@@ -39,7 +39,7 @@
# Global Variables # Global Variables
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
declare -g VERSION="1.0.0" declare -g VERSION="1.1.0"
declare -g NAME="album_rename" declare -g NAME="album_rename"
declare -g HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] <source_dir> <target_dir> <album_name>" declare -g HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] <source_dir> <target_dir> <album_name>"

View File

@@ -38,7 +38,7 @@
# Global Variables # Global Variables
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
declare -g VERSION="1.0.0" declare -g VERSION="1.1.0"
declare -g NAME="album_renum" declare -g NAME="album_renum"
declare -g HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] [-f | --first_number <first_number>] [-d | --number_of_digit <number_of_digit>] <source_dir> <target_dir>" declare -g HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] [-f | --first_number <first_number>] [-d | --number_of_digit <number_of_digit>] <source_dir> <target_dir>"

View File

@@ -39,7 +39,7 @@
# Global Variables # Global Variables
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
declare -g VERSION="1.0.0" declare -g VERSION="1.1.0"
declare -g NAME="album_retitle" declare -g NAME="album_retitle"
declare -g HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] <source_dir> <target_dir> <title_file>" declare -g HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] <source_dir> <target_dir> <title_file>"

View File

@@ -37,7 +37,7 @@
# Global Variables # Global Variables
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
declare -g VERSION="1.0.0" declare -g VERSION="1.1.0"
declare -g NAME="album_seekpoint" 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 HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] <source_dir> <target_dir> <seek_point_delay>"

View File

@@ -39,7 +39,7 @@
# Global Variables # Global Variables
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
declare -g VERSION="1.0.0" declare -g VERSION="1.1.0"
declare -g NAME="music_info" declare -g NAME="music_info"
declare -g HELP="usage: [-h | --help] | [-V | --version] | [-l | --list] [-r | --root_dir <root_dir>]" declare -g HELP="usage: [-h | --help] | [-V | --version] | [-l | --list] [-r | --root_dir <root_dir>]"

View File

@@ -39,7 +39,7 @@
# Global Variables # Global Variables
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
declare -g VERSION="1.0.0" declare -g VERSION="1.1.0"
declare -g NAME="music_check" declare -g NAME="music_check"
declare -g HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] <source_dir>" declare -g HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] <source_dir>"

View File

@@ -39,7 +39,7 @@
# Global Variables # Global Variables
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
declare -g VERSION="1.0.0" declare -g VERSION="1.1.0"
declare -g NAME="music_folder_make" declare -g NAME="music_folder_make"
declare -g HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] [-p | --music_pattern <music_pattern>] [-r | --root_dir <music_root_dir>]" declare -g HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] [-p | --music_pattern <music_pattern>] [-r | --root_dir <music_root_dir>]"

View File

@@ -39,7 +39,7 @@
# Global Variables # Global Variables
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
declare -g VERSION="1.0.0" declare -g VERSION="1.1.0"
declare -g NAME="music_tag_cleaner" declare -g NAME="music_tag_cleaner"
declare -g HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] [-f | --fix_missing_album_artist] [-a | --default_artist <default_artist>] [-p | --music_pattern <music_pattern>] [-r | --root_dir <music_root_dir>]" declare -g HELP="usage: [-h | --help] | [-V | --version] | [-T | --test] [-v | --verbose] [-f | --fix_missing_album_artist] [-a | --default_artist <default_artist>] [-p | --music_pattern <music_pattern>] [-r | --root_dir <music_root_dir>]"
@@ -174,7 +174,9 @@ do
if [[ "$(mt_tag_exist "ALBUMARTIST")" == "" ]] if [[ "$(mt_tag_exist "ALBUMARTIST")" == "" ]]
then then
echo_line "${track_file}: Copying 'ALBUM ARTIST' into 'ALBUMARTIST' Tag...\n" "${i}" echo_line "${track_file}: Copying 'ALBUM ARTIST' into 'ALBUMARTIST' Tag...\n" "${i}"
mt_tag_write "${track_file}" "ALBUMARTIST" "${tagtab["0,ALBUM ARTIST"]}"
mt_tag_get album_artist 0 "ALBUM ARTIST"
mt_tag_write "${track_file}" "ALBUMARTIST" "${album_artist}"
fi fi
echo_line "${track_file}: Cleaning 'ALBUM ARTIST' Tag...\n" "${i}" echo_line "${track_file}: Cleaning 'ALBUM ARTIST' Tag...\n" "${i}"
@@ -202,7 +204,7 @@ do
then then
echo_line "${track_file}: Warning: Missing 'ARTIST' Tag...\n" "${i}" echo_line "${track_file}: Warning: Missing 'ARTIST' Tag...\n" "${i}"
else else
artist="${tagtab["0,ARTIST"]}" mt_tag_get artist 0 "ARTIST"
fi fi
fi fi
fi fi
@@ -228,7 +230,6 @@ do
echo_line "${track_file}: OK\r" "${i}" echo_line "${track_file}: OK\r" "${i}"
i=$(( i + 1 )) i=$(( i + 1 ))
done < <(find "${ROOT_DIR}" \( -name '*.flac' -o -name '*.mp3' \) | grep -e "${MUSIC_PATTERN}" | sort) done < <(find "${ROOT_DIR}" \( -name '*.flac' -o -name '*.mp3' \) | grep -e "${MUSIC_PATTERN}" | sort)
echo_line "" echo_line ""

View File

@@ -193,10 +193,9 @@ mt_fix_file_name()
mt_tagtab_alloc() mt_tagtab_alloc()
{ {
unset TAGTAB unset TAGTAB
declare -Ag TAGTAB declare -Ag TAGTAB=()
declare -g TAGLIST declare -g TAGLIST=":"
TAGLIST=":"
} }
@@ -388,6 +387,8 @@ mt_tagtab_dump()
{ {
local track_id="$1" local track_id="$1"
local dump_mode="$2" local dump_mode="$2"
local dump_list
case "${dump_mode}" in case "${dump_mode}" in
@@ -402,7 +403,11 @@ mt_tagtab_dump()
"CUSTOM") "CUSTOM")
dump_list="$3" dump_list="$3"
;; ;;
*)
error_echo "Invalid Dump_Mode: [$dump_mode]!"
return 1
;;
esac esac
@@ -425,9 +430,9 @@ mt_tagtab_dump()
mt_tag_get() mt_tag_get()
{ {
local declare -n return=$1 declare -n return="$1"
local track_id=$2 local track_id="$2"
local tag=$3 local tag="$3"
return="${TAGTAB["${track_id},${tag}"]}" return="${TAGTAB["${track_id},${tag}"]}"
@@ -505,12 +510,12 @@ mt_tag_read()
case "${track_file}" case "${track_file}"
in in
*.flac) *.flac)
sh_exec "metaflac --show-tag=\"${tag}\" \"${track_file}\" | sed -e 's/^[^=]*=//' -e ':a' -e 'N' -e '"'$!'"ba' -e 's/\n/\\n/g'" sh_exec FORCE "metaflac --show-tag=\"${tag}\" \"${track_file}\" | sed -e 's/^[^=]*=//' -e ':a' -e 'N' -e '"'$!'"ba' -e 's/\n/\\n/g'"
;; ;;
*.mp3) *.mp3)
# sh_exec "mid3v2 --list \"${track_file}\" | tail -n +2 | sed -e 's/^[^=]*=/\U&\E/' | grep -e \"^${MT_FLAC_2_MP3_TAB[\"${tag}\"]}\" | sed -e 's/^[^=]*=//' -e ':a' -e 'N' -e '"'$!'"ba' -e 's/\n/\\n/g'" # sh_exec FORCE "mid3v2 --list \"${track_file}\" | tail -n +2 | sed -e 's/^[^=]*=/\U&\E/' | grep -e \"^${MT_FLAC_2_MP3_TAB[\"${tag}\"]}\" | sed -e 's/^[^=]*=//' -e ':a' -e 'N' -e '"'$!'"ba' -e 's/\n/\\n/g'"
sh_exec "mid3v2 --list \"${track_file}\" | tail -n +2 | grep -e \"^${tag}\" | sed -e 's/^[^=]*=//' -e ':a' -e 'N' -e '"'$!'"ba' -e 's/\n/\\n/g'" sh_exec FORCE "mid3v2 --list \"${track_file}\" | tail -n +2 | grep -e \"^${tag}\" | sed -e 's/^[^=]*=//' -e ':a' -e 'N' -e '"'$!'"ba' -e 's/\n/\\n/g'"
;; ;;
*) *)