[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/emms 5014dfa5f3 21/42: Ignore empty tags
From: |
ELPA Syncer |
Subject: |
[elpa] externals/emms 5014dfa5f3 21/42: Ignore empty tags |
Date: |
Wed, 1 Nov 2023 15:58:00 -0400 (EDT) |
branch: externals/emms
commit 5014dfa5f39ab3a805c67a3eaf84ac87d04d94fc
Author: Petteri Hintsanen <petterih@iki.fi>
Commit: Petteri Hintsanen <petterih@iki.fi>
Ignore empty tags
---
emms-info-mp3.el | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/emms-info-mp3.el b/emms-info-mp3.el
index 1e26a85e8c..ed83caed11 100644
--- a/emms-info-mp3.el
+++ b/emms-info-mp3.el
@@ -412,10 +412,11 @@ case map the reference to a string via
`emms-info-id3v1--genres';
in the latter case use the genre string verbatim.
Return a cons cell (INFO-ID . VALUE) where VALUE is the decoded
-string."
+string, or nil if the decoding failed."
(when info-id
(let ((str (emms-info-id3v2--decode-string data)))
- (cond ((stringp info-id) (cons info-id str))
+ (cond ((string-empty-p str) nil)
+ ((stringp info-id) (cons info-id str))
((eq info-id 'genre)
(if (string-match "^(?\\([0-9]+\\))?" str)
(let ((v1-genre
@@ -427,7 +428,8 @@ string."
(let* ((key-val (split-string str (string 0)))
(key (downcase (car key-val)))
(val (cadr key-val)))
- (when (rassoc key emms-info-id3v2--frame-to-info)
+ (when (and (rassoc key emms-info-id3v2--frame-to-info)
+ (not (string-empty-p val)))
(cons key val))))))))
(defun emms-info-id3v2--decode-string (bytes)
@@ -437,10 +439,10 @@ Remove the terminating null byte, if any.
Return the text as string."
(let* ((encoding (emms-info-id3v2--text-encoding bytes))
(decoded (decode-coding-string (seq-rest bytes) encoding)))
- (when (> (length decoded) 0)
- (if (equal (substring decoded -1) "\0")
- (substring decoded 0 -1)
- decoded))))
+ (if (and (> (length decoded) 0)
+ (equal (substring decoded -1) "\0"))
+ (substring decoded 0 -1)
+ decoded)))
(defun emms-info-id3v2--text-encoding (bytes)
"Return the encoding for text information BYTES."
- [elpa] externals/emms 813c0058bd 28/42: Use bindat-type in emms-info-spc, (continued)
- [elpa] externals/emms 813c0058bd 28/42: Use bindat-type in emms-info-spc, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 32b394b2b1 34/42: Change tests to use unibyte strings, ELPA Syncer, 2023/11/01
- [elpa] externals/emms c9dce6b305 36/42: Fix tests, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 93c614dc24 32/42: Fix byte compilation errors, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 83490a7218 38/42: Change all tests to use emms-test- prefix, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 8a55be19ba 06/42: Ignore empty Vorbis comments, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 9d71a515f7 09/42: Split emms-info-native to several files, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 29260a991a 11/42: Replace emms-info-native test files, ELPA Syncer, 2023/11/01
- [elpa] externals/emms fe9b0fffe1 16/42: Use strings instead of vectors for Vorbis comments, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 75f1ee292e 20/42: Add copyright information, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 5014dfa5f3 21/42: Ignore empty tags,
ELPA Syncer <=
- [elpa] externals/emms 16f107b583 24/42: Use bindat-type in emms-info-vorbis, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 6c3f1d6ab2 25/42: Use bindat-type in emms-info-opus, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 59e999a259 05/42: Fix error reporting from emms-info-native--ogg-page-bindat-spec, ELPA Syncer, 2023/11/01
- [elpa] externals/emms b512ed7331 03/42: Change magic arrays to patterns, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 5a52c1b129 22/42: Remove dependency on cl-lib, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 399dd78230 23/42: Use bindat-type in emms-info-ogg, ELPA Syncer, 2023/11/01
- [elpa] externals/emms e18b579e31 27/42: Use bindat-type in emms-info-mp3, ELPA Syncer, 2023/11/01
- [elpa] externals/emms f6bd021bc9 29/42: Compatibility code ert-resource-file, ELPA Syncer, 2023/11/01
- [elpa] externals/emms 9db19a5abd 31/42: Remove emms--use-bindat-type, ELPA Syncer, 2023/11/01
- [elpa] externals/emms c848c18727 33/42: Change to emms-info-native- prefix, ELPA Syncer, 2023/11/01