@@ -48,9 +48,8 @@ import qualified Data.ByteString.Char8 as S8
48import qualified Data.ByteString.Lazy as L
48import qualified Data.ByteString.Lazy as L
49import Data.ByteString.Lazy.Char8 ()
49import Data.ByteString.Lazy.Char8 ()
50import System.PosixCompat.Files (fileSize, getFileStatus, modificationTime)
50import System.PosixCompat.Files (fileSize, getFileStatus, modificationTime)
51−import System.Posix.Types (FileOffset, EpochTime)
51+import System.Posix.Types (EpochTime)
52import Control.Monad.IO.Class (liftIO)
52import Control.Monad.IO.Class (liftIO)
53−import Data.Maybe (catMaybes, isNothing, isJust)
54import qualified Crypto.Hash.MD5 as MD5
53import qualified Crypto.Hash.MD5 as MD5
55import Control.Monad (filterM)
54import Control.Monad (filterM)
@@ -59,8 +58,7 @@ import qualified Text.Blaze.Html5 as H
59import qualified Text.Blaze.Renderer.Utf8 as HU
58import qualified Text.Blaze.Renderer.Utf8 as HU
60import qualified Text.Blaze.Html5.Attributes as A
59import qualified Text.Blaze.Html5.Attributes as A
62−import Blaze.ByteString.Builder (toByteString, copyByteString, fromByteString)
61+import Blaze.ByteString.Builder (toByteString, fromByteString)
63−import Data.Monoid (mappend)
65import Data.Time
63import Data.Time
66import Data.Time.Clock.POSIX
64import Data.Time.Clock.POSIX
@@ -328,7 +326,7 @@ type FileLookup = Maybe (Either Folder File)
329data Folder = Folder
327data Folder = Folder
330 { folderName :: T.Text
328 { folderName :: T.Text
331− , folderContents :: [Either Folder File]
329+ , folderContents :: [Either Folder File] -- FIXME remove?
334data FolderEntry = FolderEntry -- FIXME remove
332data FolderEntry = FolderEntry -- FIXME remove
@@ -444,7 +442,7 @@ embeddedLookup root pieces =
444 Just (EEFolder y) -> elookup p ps y
442 Just (EEFolder y) -> elookup p ps y
446toEntry :: (T.Text, EmbeddedEntry) -> Either Folder File
444toEntry :: (T.Text, EmbeddedEntry) -> Either Folder File
447−toEntry (name, EEFolder e) = Left $ Folder name []
445+toEntry (name, EEFolder{}) = Left $ Folder name []
448toEntry (name, EEFile bs) = Right $ File
446toEntry (name, EEFile bs) = Right $ File
449 { fileGetSize = S8.length bs
447 { fileGetSize = S8.length bs
450 , fileToResponse = \s h -> W.ResponseBuilder s h $ fromByteString bs
448 , fileToResponse = \s h -> W.ResponseBuilder s h $ fromByteString bs
@@ -643,7 +641,7 @@ defaultListing pieces (Folder _ contents) = do
643 showFolder (x:xs) = do
641 showFolder (x:xs) = do
644 let href = concat $ replicate (length xs) "../" :: String
642 let href = concat $ replicate (length xs) "../" :: String
645 H.a ! A.href (H.toValue href) $ H.toHtml $ showName x
643 H.a ! A.href (H.toValue href) $ H.toHtml $ showName x
646− " / "
644+ () <- " / "
647 showFolder xs
645 showFolder xs
649-- | a function to generate an HTML table showing the contents of a directory on the disk
647-- | a function to generate an HTML table showing the contents of a directory on the disk