From aaf97fcbd6f52b0e2a36726fe8e1f6e1eff78bb4 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Sun, 25 Sep 2005 16:03:00 +0000 Subject: emms-streams.el: Update `emms-info-file-info-song-artist' so that it can deal with the new interface. darcs-hash:20050925160336-1bfb2-95abcbab9f4d62c6d8dee2b7a8b3b8523e4089a4.gz --- emms-streams.el | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/emms-streams.el b/emms-streams.el index 003e4c0..a52e0f8 100644 --- a/emms-streams.el +++ b/emms-streams.el @@ -414,17 +414,17 @@ Don't forget to save your modifications !" (defun emms-info-file-info-song-artist (track) "Returns a description of TRACK, build from its comments. -If `emms-info-methods-list' indicates how to retrieve special info -about it, use this. Otherwise returns the name alone." - (if (not (and track (emms-track-name track))) - "Invalid track!" - (let ((info (emms-info-get track))) - (if (eq (emms-info-method-for track) 'emms-info-url) - (progn - (concat (emms-info-artist info) " - " (emms-info-title info))) - (if (and info (not (string= (emms-info-artist info) "")) (not (string= (emms-info-title info) ""))) - (concat (emms-info-artist info) " - " (emms-info-title info)) - (file-name-sans-extension (file-name-nondirectory (emms-track-name track)))))))) +If the track already indicates artist and title, use it. +Otherwise return the name of the track." + (let ((name (and track (emms-track-name track)))) + (if (null name) + "Invalid track!" + (let ((artist (emms-track-get track 'info-artist)) + (title (emms-track-get track 'info-title))) + (if (and artist (not (string= artist "")) + title (not (string= title ""))) + (concat artist " - " title) + (file-name-sans-extension (file-name-nondirectory name))))))) (defun emms-stream-add-data-to-track (track) (emms-track-set track 'metadata emms-stream-last-stream)) -- cgit v1.2.3