From 22b4cd323252dd53a545ec327fa2ff772ce34c13 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Thu, 25 Jun 2026 13:41:22 -0400 Subject: [PATCH] metadata.c get_metadata_ex add flag METADATA_EXCLUDE_NORMALIZE no need to normalize data you don't intend to use Change-Id: Ieef5474fef47b2f96db3d02875db95a1de02eb5e --- lib/rbcodec/metadata/metadata.c | 2 +- lib/rbcodec/metadata/metadata.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/rbcodec/metadata/metadata.c b/lib/rbcodec/metadata/metadata.c index 446eb34ab1..4e42735b88 100644 --- a/lib/rbcodec/metadata/metadata.c +++ b/lib/rbcodec/metadata/metadata.c @@ -475,7 +475,7 @@ bool get_metadata_ex(struct mp3entry* id3, int fd, const char* trackname, int fl } #ifdef UTF8PROC_EXPORTS - if (success) { + if (success && (flags & METADATA_EXCLUDE_NORMALIZE) == 0) { utf8_normalize(id3->title); utf8_normalize(id3->artist); utf8_normalize(id3->album); diff --git a/lib/rbcodec/metadata/metadata.h b/lib/rbcodec/metadata/metadata.h index 5f9d03a527..110bee1f7d 100644 --- a/lib/rbcodec/metadata/metadata.h +++ b/lib/rbcodec/metadata/metadata.h @@ -23,8 +23,9 @@ #include "platform.h" -#define METADATA_EXCLUDE_ID3_PATH (0x01) /* don't copy filename path to the id3 path buffer */ -#define METADATA_CLOSE_FD_ON_EXIT (0x02) /* close the filedescriptor when finished */ +#define METADATA_EXCLUDE_ID3_PATH (0x01) /* don't copy filename path to the id3 path buffer */ +#define METADATA_CLOSE_FD_ON_EXIT (0x02) /* close the filedescriptor when finished */ +#define METADATA_EXCLUDE_NORMALIZE (0x04) /* don't normalize id3 text entries */ /* Audio file types. */ /* NOTE: The values of the AFMT_* items are used for the %fc tag in the WPS - so new entries MUST be added to the end to maintain compatibility.