aboutsummaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-11-30 13:39:20 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-11-30 13:43:55 -0400
commit51ab2efc693983dcca6d79b531339b00e23fa871 (patch)
treefbd89e612e010b4dd47fa79a89b119c081aa7fb4 /Command
parentc70952118b9a453d998752a5fe6e5ace3d91ec99 (diff)
avoid warning when youtube-dl is not installed
If a user does not have it installed, don't warn on every imported item about it.
Diffstat (limited to 'Command')
-rw-r--r--Command/ImportFeed.hs19
1 files changed, 7 insertions, 12 deletions
diff --git a/Command/ImportFeed.hs b/Command/ImportFeed.hs
index c860f637f..1720060bd 100644
--- a/Command/ImportFeed.hs
+++ b/Command/ImportFeed.hs
@@ -286,18 +286,13 @@ performDownload opts cache todownload = case location todownload of
return False
Right b -> return b
- addmediafast linkurl mediaurl mediakey =
- youtubeDlSupported linkurl >>= \case
- Right True ->
- rundownload linkurl ".m" $ \f -> do
- addWorkTree webUUID mediaurl f mediakey Nothing
- return [mediakey]
- Right False ->
- performDownload opts cache todownload
- { location = Enclosure linkurl }
- Left msg -> do
- warning msg
- return False
+ addmediafast linkurl mediaurl mediakey = ifM (youtubeDlSupported linkurl)
+ ( rundownload linkurl ".m" $ \f -> do
+ addWorkTree webUUID mediaurl f mediakey Nothing
+ return [mediakey]
+ , performDownload opts cache todownload
+ { location = Enclosure linkurl }
+ )
defaultTemplate :: String
defaultTemplate = "${feedtitle}/${itemtitle}${extension}"