@@ -193,9 +193,7 @@ pPlaying dd = FancyS $ map (, defaultSty) $ " " : line where
193193pId3 :: DrawData -> ByteString
194194pId3 DD {drawState= st} = case id3 st of
195195 Just i -> id3str i
196- Nothing -> case size st of
197- 0 -> " (empty)"
198- _ -> fbase $ music st ! current st
196+ Nothing -> fbase $ music st ! current st
199197
200198-- | mp3 information
201199pInfo :: DrawData -> ByteString
@@ -315,26 +313,22 @@ pMode dd = take 4 $ map toLower $ show $ mode $ drawState dd
315313
316314------------------------------------------------------------------------
317315
318- -- | "x/n dir(s) y/m file(s) " cursor position read-out.
316+ -- | "x/n dirs y/m files " cursor position read-out.
319317playInfo :: DrawData -> ByteString
320318playInfo dd = mconcat
321- -- TODO pregenerate as template
322319 [ spaces (P. length numd - P. length curd)
323- , curd, " /" , numd, " dir" , onPlural (snd . bounds $ folders st) " " " s"
324- , " "
325- , spaces (P. length numf - P. length curf)
326- , curf, " /" , numf, " file" , onPlural (size st) " " " s"
320+ , curd, " /" , numd, " dirs"
321+ , spaces (1 + P. length numf - P. length curf)
322+ , curf, " /" , numf, " files"
327323 ]
328324 where
329325 st = drawState dd
330326 tobs = P. pack . show
331- onPlural 1 s _ = s
332- onPlural _ _ p = p
333327 curf = tobs $ 1 + cursor st
334328 numf = tobs $ size st
335329 mydir = fdir $ music st ! cursor st
336330 curd = tobs $ 1 + mydir
337- numd = tobs $ 1 + snd (bounds $ folders st)
331+ numd = tobs $ length $ folders st
338332
339333-- | The top title bar: cursor position + play indicator + uptime + version.
340334playTitle :: DrawData -> StringA
@@ -427,10 +421,7 @@ playList dd@DD{ drawSize=Size y x, drawPos=Pos{posY=o}, drawState=st } =
427421 : map (, sty) v
428422 where
429423 sty' = if sty == sty2 || sty == sty3 then sty2 else sty1
430- d = toMaxWidth (indent - 1 ) $ takeFileName
431- $ case size st of
432- 0 -> " (empty)"
433- _ -> dname $ folders st ! i
424+ d = toMaxWidth (indent - 1 ) $ takeFileName $ dname $ folders st ! i
434425
435426------------------------------------------------------------------------
436427
0 commit comments