From 2298881174cc0144df6eb22d6876d0d8bab79b74 Mon Sep 17 00:00:00 2001 From: "Arnaud G. GIBERT" Date: Wed, 2 Sep 2026 23:34:23 +0200 Subject: [PATCH] - Fix metadata load/save bugs in music_tools lib. --- ReleaseNotes.txt | 8 ++++++++ SPECS/music_tools.spec | 5 ++++- lib/rx3/music_tools.bash | 34 ++++++++++++++++++++++------------ 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index dfeb1a9..c00d4c6 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -1,3 +1,11 @@ +------------------------------------------------------------------------------------------------------------------------------------ +Music Tools V 1.1.2 - A. GIBERT - 2026/09/02 +------------------------------------------------------------------------------------------------------------------------------------ + +- Fix metadata load/save bugs in music_tools lib. + + + ------------------------------------------------------------------------------------------------------------------------------------ Music Tools V 1.1.1 - A. GIBERT - 2026/05/03 ------------------------------------------------------------------------------------------------------------------------------------ diff --git a/SPECS/music_tools.spec b/SPECS/music_tools.spec index 899d3f6..259b3f1 100644 --- a/SPECS/music_tools.spec +++ b/SPECS/music_tools.spec @@ -25,7 +25,7 @@ %define name music_tools -%define version 1.1.1 +%define version 1.1.2 %define release %mkrel 1rx3 @@ -127,6 +127,9 @@ cp bin/* %{buildroot}%{_bindir} #----------------------------------------------------------------------------------------------------------------------------------- %changelog +* Wed Sep 2 2026 Arnaud G. GIBERT - 1.1.2-1rx3.mga9 +- Update to 1.1.2 release + * Sun May 3 2026 Arnaud G. GIBERT - 1.1.1-1rx3.mga9 - Update to 1.1.1 release - Add rx3-base-libs depedency diff --git a/lib/rx3/music_tools.bash b/lib/rx3/music_tools.bash index acd3578..5713552 100644 --- a/lib/rx3/music_tools.bash +++ b/lib/rx3/music_tools.bash @@ -249,9 +249,9 @@ mt_tagtab_read() TAGLIST="${TAGLIST}${tag}:" fi - if [[ ( "${mode}" != "FACTORING" ) || ( "${tag}" =~ ^${MT_NODEF_TAG_COND}$ ) || ( -v "TAGTAB[\"0,${tag}\"]}" ) ]] + if [[ ( "${mode}" != "FACTORING" ) || ( "${tag}" =~ ^${MT_NODEF_TAG_COND}$ ) || ( -v "TAGTAB[\"0,${tag}\"]" ) ]] then - if [[ ( ! -v "TAGTAB[\"0,${tag}\"]}" ) || ( "${TAGTAB["0,${tag}"]}" != "${value}") ]] + if [[ ( ! -v "TAGTAB[\"0,${tag}\"]" ) || ( "${TAGTAB["0,${tag}"]}" != "${value}") ]] then TAGTAB["${track_id},${tag}"]="$value" fi @@ -279,10 +279,10 @@ mt_tagtab_read() then TAGLIST="${TAGLIST}${tag}:" fi - - if [[ ( "${mode}" != "FACTORING" ) || ( "${tag}" =~ ^${MT_NODEF_TAG_COND}$ ) || ( "${TAGTAB["0,${tag}"]}" != "" ) ]] - then - if [[ "${TAGTAB["0,${tag}"]}" != "${value}" ]] + + if [[ ( "${mode}" != "FACTORING" ) || ( "${tag}" =~ ^${MT_NODEF_TAG_COND}$ ) || ( -v "TAGTAB[\"0,${tag}\"]" ) ]] + then + if [[ ( ! -v "TAGTAB[\"0,${tag}\"]" ) || ( "${TAGTAB["0,${tag}"]}" != "${value}") ]] then TAGTAB["${track_id},${tag}"]="$value" fi @@ -434,12 +434,22 @@ mt_tag_get() local track_id="$2" local tag="$3" - - return="${TAGTAB["${track_id},${tag}"]}" + if [[ -v "TAGTAB[\"${track_id},${tag}\"]" ]] + then + return="${TAGTAB["${track_id},${tag}"]}" + else + return="" + fi + if [[ "${return}" == "" ]] then - return="${TAGTAB["0,${tag}"]}" + if [[ -v "TAGTAB[\"0,${tag}\"]" ]] + then + return="${TAGTAB["0,${tag}"]}" + else + return="" + fi if [[ "${return}" == "" ]] && [[ "${tag}" == "TRACKNUMBER" ]] then @@ -510,12 +520,12 @@ mt_tag_read() case "${track_file}" in *.flac) - sh_exec FORCE "metaflac --show-tag=\"${tag}\" \"${track_file}\" | sed -e 's/^[^=]*=//' -e ':a' -e 'N' -e '"'$!'"ba' -e 's/\n/\\n/g'" + sh_exec "metaflac --show-tag=\"${tag}\" \"${track_file}\" | sed -e 's/^[^=]*=//' -e ':a' -e 'N' -e '"'$!'"ba' -e 's/\n/\\n/g'" ;; *.mp3) -# 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 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'" +# 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 "mid3v2 --list \"${track_file}\" | tail -n +2 | grep -e \"^${tag}\" | sed -e 's/^[^=]*=//' -e ':a' -e 'N' -e '"'$!'"ba' -e 's/\n/\\n/g'" ;; *)