aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoni Rabkin <yoni@rabkins.net>2021-05-14 16:22:04 -0400
committerYoni Rabkin <yoni@rabkins.net>2021-05-14 16:22:04 -0400
commit41a820533f608c746d1a43c6d3095f666d0d3c22 (patch)
tree955bc05d9b9dabc29dd47ed098c1e587b19c03a4
parent5e0b2a93c340c46daa42f5139acbaae869bddb4e (diff)
* emms-info-native.el: catch errors
Otherwise, adding tracks will halt at the error.
-rw-r--r--emms-info-native.el25
1 files changed, 14 insertions, 11 deletions
diff --git a/emms-info-native.el b/emms-info-native.el
index 8601dd0..3e3e2d4 100644
--- a/emms-info-native.el
+++ b/emms-info-native.el
@@ -927,17 +927,20 @@ Return the text as string."
(defun emms-info-native (track)
"Set info fields for TRACK.
Supports Ogg Vorbis/Opus, FLAC, and MP3 files."
- (let* ((filename (emms-track-name track))
- (info-fields (emms-info-native--decode-info-fields filename)))
- (dolist (field info-fields)
- (let ((name (intern (concat "info-" (car field))))
- (value (cdr field)))
- (unless (zerop (length value))
- (emms-track-set track
- name
- (if (eq name 'info-playing-time)
- (string-to-number value)
- (string-trim-right value))))))))
+ (condition-case env
+ (let* ((filename (emms-track-name track))
+ (info-fields (emms-info-native--decode-info-fields filename)))
+ (dolist (field info-fields)
+ (let ((name (intern (concat "info-" (car field))))
+ (value (cdr field)))
+ (unless (zerop (length value))
+ (emms-track-set track
+ name
+ (if (eq name 'info-playing-time)
+ (string-to-number value)
+ (string-trim-right value)))))))
+ (error (message "emms-info-native error processing %s: %s"
+ (emms-track-name track) env))))
(defun emms-info-native--decode-info-fields (filename)
"Decode info fields from FILENAME.