emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/emms b7684ba 39/80: Match id3v1 genres in id3v2.4 frame


From: Stefan Monnier
Subject: [elpa] externals/emms b7684ba 39/80: Match id3v1 genres in id3v2.4 frame
Date: Wed, 17 Mar 2021 18:42:26 -0400 (EDT)

branch: externals/emms
commit b7684baef60f08a04e4e598ee21a5ea55ef23bd5
Author: Petteri Hintsanen <phintsan@julia.lan>
Commit: Petteri Hintsanen <phintsan@julia.lan>

    Match id3v1 genres in id3v2.4 frame
    
    v2.4 does not enclose genre references in parentheses.
---
 emms-info-native.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/emms-info-native.el b/emms-info-native.el
index e3181ef..405bf25 100644
--- a/emms-info-native.el
+++ b/emms-info-native.el
@@ -878,10 +878,11 @@ with key/value-pair.  Extract the key and, if it is a 
mapped
 element in `emms-info-native--id3v2-frame-to-info', use it as
 INFO-ID.
 
-If INFO-ID is `genre', assume that DATA is either id3v1 genre
-reference \"(XX)\" or plain genre string.  In the former case,
-map XX to a string via `emms-info-native--id3v1-genres'; in the
-latter case use the genre string verbatim.
+If INFO-ID is `genre', assume that DATA is either an integral
+id3v1 genre reference or a plain genre string.  In the former
+case map the reference to a string via
+`emms-info-native--id3v1-genres'; in the latter case use the
+genre string verbatim.
 
 Return a cons cell (INFO-ID . VALUE) where VALUE is the decoded
 string."
@@ -889,7 +890,7 @@ string."
     (let ((str (emms-info-native--decode-id3v2-string data)))
       (cond ((stringp info-id) (cons info-id str))
             ((eq info-id 'genre)
-             (if (string-match "^(\\([0-9]+\\))" str)
+             (if (string-match "^(?\\([0-9]+\\))?" str)
                  (let ((v1-genre (assoc (string-to-number (match-string 1 str))
                                         emms-info-native--id3v1-genres)))
                    (when v1-genre (cons "genre" (cdr v1-genre))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]