diff options
-rw-r--r-- | emms-streams.el | 22 |
1 files 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)) |