allow extra images etc
This commit is contained in:
parent
813d802fce
commit
6c84d4eb1c
2 changed files with 16 additions and 13 deletions
|
@ -40,7 +40,8 @@ data Info =
|
|||
nsfwDesc :: !(Maybe Text),
|
||||
images :: ![Image],
|
||||
thumb' :: !(Maybe FilePath),
|
||||
links :: ![Link]
|
||||
links :: ![Link],
|
||||
extras :: ![FilePath]
|
||||
}
|
||||
deriving (Eq, Show)
|
||||
|
||||
|
@ -117,16 +118,17 @@ instance Ord Info where
|
|||
|
||||
instance FromYAML Info where
|
||||
parseYAML = YAML.withMap "info" \m ->
|
||||
Info <$> m .: "date"
|
||||
<*> m .: "title"
|
||||
<*> m .:? "artist"
|
||||
<*> m .:? "tags" .!= []
|
||||
<*> m .:? "nsfw-tags" .!= []
|
||||
<*> m .:? "desc"
|
||||
<*> m .:? "nsfw-desc"
|
||||
Info <$> m .: "date"
|
||||
<*> m .: "title"
|
||||
<*> m .:? "artist"
|
||||
<*> m .:? "tags" .!= []
|
||||
<*> m .:? "nsfw-tags" .!= []
|
||||
<*> m .:? "desc"
|
||||
<*> m .:? "nsfw-desc"
|
||||
<*> (m .: "images" >>= imageList)
|
||||
<*> m .:? "thumb"
|
||||
<*> m .:? "links" .!= []
|
||||
<*> m .:? "thumb"
|
||||
<*> m .:? "links" .!= []
|
||||
<*> m .:? "extras" .!= []
|
||||
|
||||
instance FromYAML Artist where
|
||||
parseYAML y = justName y <|> withUrl y where
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue