aboutsummaryrefslogtreecommitdiff
path: root/Annex
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 /Annex
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 'Annex')
-rw-r--r--Annex/YoutubeDl.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Annex/YoutubeDl.hs b/Annex/YoutubeDl.hs
index 18e363eb5..1eafa4173 100644
--- a/Annex/YoutubeDl.hs
+++ b/Annex/YoutubeDl.hs
@@ -80,9 +80,12 @@ youtubeDlTo key url dest = do
return False
Right r -> return r
+youtubeDlSupported :: URLString -> Annex Bool
+youtubeDlSupported url = either (const False) id <$> youtubeDlCheck url
+
-- Check if youtube-dl can still find media in an url.
-youtubeDlSupported :: URLString -> Annex (Either String Bool)
-youtubeDlSupported url = catchMsgIO $ do
+youtubeDlCheck :: URLString -> Annex (Either String Bool)
+youtubeDlCheck url = catchMsgIO $ do
opts <- map Param . annexYoutubeDlOptions <$> Annex.getGitConfig
let opts' = opts ++ [ Param url, Param "--simulate" ]
liftIO $ snd <$> processTranscript "youtube-dl" (toCommand opts') Nothing