diff --git a/app/EpubParser.hs b/app/EpubParser.hs index 68ab427..9b5480b 100644 --- a/app/EpubParser.hs +++ b/app/EpubParser.hs @@ -61,9 +61,7 @@ openEpub path = do getOpfPath :: Archive -> Maybe String getOpfPath arch = - case findEntryByPath "META-INF/container.xml" arch of - Nothing -> Nothing - Just entry -> getRootPath (TE.decodeUtf8 . B.toStrict $ fromEntry entry) + maybe Nothing (\e -> getRootPath (TE.decodeUtf8 . B.toStrict $ fromEntry e)) (findEntryByPath "META-INF/container.xml" arch) getRootPath :: T.Text -> Maybe String getRootPath rawhtml =