aboutsummaryrefslogtreecommitdiff
path: root/Command/ImportFeed.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-11-30 13:45:43 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-11-30 14:13:20 -0400
commit7a8d7ba5ef558f3038ee5ee06e92e5f5e8df1ec5 (patch)
tree3a2482329870e768f4f92240ae14d61c7768bd0d /Command/ImportFeed.hs
parent51ab2efc693983dcca6d79b531339b00e23fa871 (diff)
rethought --relaxed change
Better to make it not be surprising and slow, than surprising and fast. --raw can be used when it needs to be really fast. Implemented adding a youtube-dl supported url to an existing file. This commit was sponsored by andrea rota.
Diffstat (limited to 'Command/ImportFeed.hs')
-rw-r--r--Command/ImportFeed.hs14
1 files changed, 6 insertions, 8 deletions
diff --git a/Command/ImportFeed.hs b/Command/ImportFeed.hs
index 1720060bd..c003302b6 100644
--- a/Command/ImportFeed.hs
+++ b/Command/ImportFeed.hs
@@ -272,19 +272,17 @@ performDownload opts cache todownload = case location todownload of
ok <- rundownload linkurl ext $ \f -> do
addWorkTree webUUID mediaurl f mediakey (Just mediafile)
return [mediakey]
- return (Right ok)
+ return (Just ok)
-- youtude-dl didn't support it, so
-- download it as if the link were
-- an enclosure.
- Right Nothing -> Right <$>
+ Right Nothing -> Just <$>
performDownload opts cache todownload
{ location = Enclosure linkurl }
- Left msg -> return (Left msg)
- case r of
- Left msg -> do
- warning msg
- return False
- Right b -> return b
+ Left msg -> do
+ warning msg
+ return Nothing
+ return (fromMaybe False r)
addmediafast linkurl mediaurl mediakey = ifM (youtubeDlSupported linkurl)
( rundownload linkurl ".m" $ \f -> do