diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/media/jao-emms-info-track.el | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/media/jao-emms-info-track.el b/lib/media/jao-emms-info-track.el index ac9fa74..d848145 100644 --- a/lib/media/jao-emms-info-track.el +++ b/lib/media/jao-emms-info-track.el @@ -54,11 +54,14 @@ (defun jao-emms-info-track-stream (track) "Return track info for streams" - (let ((name (emms-track-name track)) - (title (or (emms-track-get track 'title nil) - (car (emms-track-get track 'metadata nil)) - (car (split-string (shell-command-to-string "mpc status") - "\n"))))) + (let* ((name (emms-track-name track)) + (title (or (emms-track-get track 'title nil) + (car (emms-track-get track 'metadata nil)) + (car (split-string (shell-command-to-string "mpc status") + "\n")))) + (title (if (string-match "https?://\\([^/]+\\)/.+" (or title "")) + (match-string 1 title) + title))) (format " %s (%s)" (or title "") (if title (emms-track-type track) name)))) (defsubst jao--put-face (str face) |