Add tag extractor

This commit is contained in:
Marko Andjelic 2026-01-24 00:33:53 +00:00
commit f32ddea748

View file

@ -47,6 +47,12 @@ getOpfPath archive = do
(t:_) -> Just (fromAttrib "full-path" t)
[] -> Nothing
getOpfTags :: Archive -> FilePath -> [Tag String]
getOpfTags archive opfpath =
case findEntryByPath opfpath archive of
Just entry -> parseTags $ C8.unpack (fromEntry entry)
Nothing -> []
getRootPrefix :: FilePath -> FilePath
getRootPrefix path =
let dir = takeDirectory path