From d2b16c9b7fb1507aff44f301fef9109320895456 Mon Sep 17 00:00:00 2001 From: Delapouite Date: Tue, 1 Mar 2016 13:08:05 +0100 Subject: feat(MPD): add support in template --- readme.md | 2 +- src/Plugins/Monitors/MPD.hs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 37d4f3c..4c3af93 100644 --- a/readme.md +++ b/readme.md @@ -1097,7 +1097,7 @@ more than one battery. `plength` (playlist length), `ppos` (playlist position), `flags` (ncmpcpp-style playback mode), `name`, `artist`, `composer`, `performer`, - `album`, `title`, `track`, `file`, `genre` + `album`, `title`, `track`, `file`, `genre`, `date` - Default template: `MPD: ` - Example (note that you need "--" to separate regular monitor options from MPD's specific ones): diff --git a/src/Plugins/Monitors/MPD.hs b/src/Plugins/Monitors/MPD.hs index 0efceb1..0676e64 100644 --- a/src/Plugins/Monitors/MPD.hs +++ b/src/Plugins/Monitors/MPD.hs @@ -26,7 +26,7 @@ mpdConfig = mkMConfig "MPD: " [ "bar", "vbar", "ipat", "state", "statei", "volume", "length" , "lapsed", "remaining", "plength", "ppos", "flags", "file" , "name", "artist", "composer", "performer" - , "album", "title", "track", "genre" + , "album", "title", "track", "genre", "date" ] data MOpts = MOpts @@ -126,7 +126,7 @@ parseSong (Right Nothing) = return $ repeat "" parseSong (Right (Just s)) = let str sel = maybe "" (intercalate ", " . map M.toString) (M.sgGetTag sel s) sels = [ M.Name, M.Artist, M.Composer, M.Performer - , M.Album, M.Title, M.Track, M.Genre ] + , M.Album, M.Title, M.Track, M.Genre, M.Date ] fields = M.toString (M.sgFilePath s) : map str sels in mapM showWithPadding fields -- cgit v1.2.3