translate _ to space in pathToLabel

This commit is contained in:
Rhiannon Morris 2021-03-20 11:07:51 +01:00
parent ace57a50f9
commit 8b25a3d712

View file

@ -272,8 +272,8 @@ unlabelledImage' label' y = asStr y <|> asObj y
warning <- m .:? "warning" warning <- m .:? "warning"
let label = fromMaybe (pathToLabel path) label' let label = fromMaybe (pathToLabel path) label'
pure $ Image {label, path, download, nsfw, warning} pure $ Image {label, path, download, nsfw, warning}
pathToLabel = Text.pack . dashToSpace . takeBaseName pathToLabel = Text.pack . gapToSpace . takeBaseName
dashToSpace = map \case '-' -> ' '; c -> c gapToSpace = map \case '-' -> ' '; '_' -> ' '; c -> c
instance FromYAML Link where instance FromYAML Link where
parseYAML = parseYAML =