unregisterurl: remove all forms of an url, no matter what the downloader is set to
unregisterurl: Fix a bug that caused an url to not be unregistered when it
is claimed by a special remote other than the web.
See commit f175d4cc90
for rationalle.
This commit is contained in:
parent
c984d248d2
commit
0af9d1dcb6
2 changed files with 13 additions and 2 deletions
|
@ -12,6 +12,8 @@ git-annex (8.20210311) UNRELEASED; urgency=medium
|
||||||
prefixed with "yt:" in order to be removed.
|
prefixed with "yt:" in order to be removed.
|
||||||
* rmurl: If an url is both used by the web and also claimed by another
|
* 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.
|
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 <id@joeyh.name> Fri, 12 Mar 2021 12:06:37 -0400
|
-- Joey Hess <id@joeyh.name> Fri, 12 Mar 2021 12:06:37 -0400
|
||||||
|
|
||||||
|
|
|
@ -21,5 +21,14 @@ cmd = command "unregisterurl"
|
||||||
|
|
||||||
seek :: RegisterUrlOptions -> CommandSeek
|
seek :: RegisterUrlOptions -> CommandSeek
|
||||||
seek o = case (batchOption o, keyUrlPairs o) of
|
seek o = case (batchOption o, keyUrlPairs o) of
|
||||||
(Batch fmt, _) -> commandAction $ startMass setUrlMissing fmt
|
(Batch fmt, _) -> commandAction $ startMass unregisterUrl fmt
|
||||||
(NoBatch, ps) -> withWords (commandAction . start setUrlMissing) ps
|
(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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue