diff --git a/CHANGELOG b/CHANGELOG index 1a23d6722c..1df80e22d5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -12,6 +12,8 @@ git-annex (8.20210311) UNRELEASED; urgency=medium prefixed with "yt:" in order to be removed. * rmurl: If an url is both used by the web and also claimed by another special remote, fix a bug that caused the url to to not be removed. + * unregisterurl: Fix a bug that caused an url to not be unregistered + when it is claimed by a special remote other than the web. -- Joey Hess Fri, 12 Mar 2021 12:06:37 -0400 diff --git a/Command/UnregisterUrl.hs b/Command/UnregisterUrl.hs index 6a44248b2f..7d4d65beb7 100644 --- a/Command/UnregisterUrl.hs +++ b/Command/UnregisterUrl.hs @@ -21,5 +21,14 @@ cmd = command "unregisterurl" seek :: RegisterUrlOptions -> CommandSeek seek o = case (batchOption o, keyUrlPairs o) of - (Batch fmt, _) -> commandAction $ startMass setUrlMissing fmt - (NoBatch, ps) -> withWords (commandAction . start setUrlMissing) ps + (Batch fmt, _) -> commandAction $ startMass unregisterUrl fmt + (NoBatch, ps) -> withWords (commandAction . start unregisterUrl) ps + +unregisterUrl :: Key -> String -> Annex () +unregisterUrl key url = do + -- Remove the url no matter what downloader; + -- registerurl can set OtherDownloader, and this should also + -- be able to remove urls added by addurl, which may use + -- YoutubeDownloader. + forM_ [minBound..maxBound] $ \dl -> + setUrlMissing key (setDownloader url dl)