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.
This commit is contained in:
parent
a7b4358c05
commit
8a0038ec23
3 changed files with 13 additions and 15 deletions
|
@ -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}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue