diff options
Diffstat (limited to 'lib/media')
-rw-r--r-- | lib/media/jao-mpc.el | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/media/jao-mpc.el b/lib/media/jao-mpc.el index 2dfec76..5228787 100644 --- a/lib/media/jao-mpc.el +++ b/lib/media/jao-mpc.el @@ -47,11 +47,12 @@ (mapconcat (lambda (f) (format "%s:::%%%s%%" f f)) fields "\n")) (defconst jao-mpc--fields - '(artist album composer originaldate genre title track position time name)) + '(artist album composer originaldate genre title track position time name + file)) (defconst jao-mpc--stfmt (jao-mpc--fformat - '(artist album composer originaldate genre title track name))) + '(artist album composer originaldate genre title track name file))) (defconst jao-mpc--stfmtt (jao-mpc--fformat '(currenttime totaltime percenttime songpos length))) @@ -261,10 +262,13 @@ (defun jao-mpc-notify (&optional port) (interactive) (when-let* ((current (jao-mpc--current))) - (let* ((artist (alist-get 'artist current)) - (title (alist-get 'title current)) - (album (alist-get 'album current)) - (track (alist-get 'track current)) + (let* ((artist (or (alist-get 'artist current) "Anonymous")) + (title (or (alist-get 'title current) + (when-let* ((tl (alist-get 'file current))) + (file-name-base tl)) + "")) + (album (or (alist-get 'album current) "")) + (track (or (alist-get 'track current) "")) (times (jao-mpc--current-timestr t current))) (jao-notify (format "%s -- %s" artist times) (format "%s %s" track title) |