diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-12-31 14:55:51 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-12-31 14:55:51 -0400 |
commit | 2736807f86a03741d6339203c594e0c73a8fafad (patch) | |
tree | 2c43579692d9a16e18e6a55a4c486033a49eb130 /Annex | |
parent | cbb7f306b8f8f2672ea34b040a0010739f722310 (diff) |
repeated addurl behavior reversion fix
addurl: When the file youtube-dl will download is already an annexed file,
don't download it again and fail to overwrite it, instead just do nothing,
like it used to when quvi was used.
This commit was sponsored by Anthony DeRobertis on Patreon.
Diffstat (limited to 'Annex')
-rw-r--r-- | Annex/YoutubeDl.hs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Annex/YoutubeDl.hs b/Annex/YoutubeDl.hs index d1cac9368..43e63dfd6 100644 --- a/Annex/YoutubeDl.hs +++ b/Annex/YoutubeDl.hs @@ -11,6 +11,7 @@ module Annex.YoutubeDl ( youtubeDlSupported, youtubeDlCheck, youtubeDlFileName, + youtubeDlFileName', ) where import Annex.Common @@ -144,7 +145,16 @@ youtubeDlCheck url youtubeDlFileName :: URLString -> Annex (Either String FilePath) youtubeDlFileName url | supportedScheme url = flip catchIO (pure . Left . show) $ - htmlOnly url nomedia go + htmlOnly url nomedia (youtubeDlFileName' url) + | otherwise = return nomedia + where + nomedia = Left "no media in url" + +-- Does not check if the url contains htmlOnly; use when that's already +-- been verified. +youtubeDlFileName' :: URLString -> Annex (Either String FilePath) +youtubeDlFileName' url + | supportedScheme url = flip catchIO (pure . Left . show) go | otherwise = return nomedia where go = do |