include url in json output
The input field is consistently the url of the feed, which makes sense as that is the user input, but to differentiate multiple urls downloaded from a feed when using --json-progress -J, need the url that is being downloaded too. Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
This commit is contained in:
parent
7919349cee
commit
2fdf0ae38d
1 changed files with 8 additions and 4 deletions
|
@ -459,14 +459,18 @@ runDownload todownload url extension cache cv getter = do
|
|||
)
|
||||
|
||||
startUrlDownload :: TMVar Bool -> ToDownload -> URLString -> CommandPerform -> CommandStart
|
||||
startUrlDownload cv todownload url a = starting "addurl"
|
||||
(ActionItemOther (Just (UnquotedString url)))
|
||||
(SeekInput [feedurl todownload])
|
||||
(a `onException` recordfailure)
|
||||
startUrlDownload cv todownload url a = do
|
||||
starting "addurl"
|
||||
(ActionItemOther (Just (UnquotedString url)))
|
||||
(SeekInput [feedurl todownload])
|
||||
(go `onException` recordfailure)
|
||||
where
|
||||
recordfailure = do
|
||||
void $ feedProblem url "download failed"
|
||||
liftIO $ atomically $ tryPutTMVar cv False
|
||||
go = do
|
||||
maybeAddJSONField "url" url
|
||||
a
|
||||
|
||||
defaultTemplate :: String
|
||||
defaultTemplate = "${feedtitle}/${itemtitle}${extension}"
|
||||
|
|
Loading…
Reference in a new issue