diff options
Diffstat (limited to 'src/Plugins/Monitors/MPD.hs')
-rw-r--r-- | src/Plugins/Monitors/MPD.hs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Plugins/Monitors/MPD.hs b/src/Plugins/Monitors/MPD.hs index 450ad8f..96a8f1d 100644 --- a/src/Plugins/Monitors/MPD.hs +++ b/src/Plugins/Monitors/MPD.hs @@ -14,6 +14,7 @@ module Plugins.Monitors.MPD ( mpdConfig, runMPD, mpdWait ) where +import Data.List import Plugins.Monitors.Common import System.Console.GetOpt import qualified Network.MPD as M @@ -93,9 +94,7 @@ parseSong :: M.Response (Maybe M.Song) -> Monitor [String] parseSong (Left _) = return $ repeat "" parseSong (Right Nothing) = return $ repeat "" parseSong (Right (Just s)) = - let join [] = "" - join (x:xs) = foldl (\a o -> a ++ ", " ++ o) x xs - str sel = maybe "" (join . map M.toString) (M.sgGetTag sel 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 ] fields = M.toString (M.sgFilePath s) : map str sels |