Display progress meter in -J mode when downloading from the web.

Including in addurl, and get --from web, but also in S3 and External
special remotes when a web url is known for content in those remotes.
This commit is contained in:
Joey Hess 2015-11-16 21:00:54 -04:00
parent 1244eb3770
commit e97fce35a6
Failed to extract signature
9 changed files with 36 additions and 30 deletions

View file

@ -252,9 +252,9 @@ addUrlFileQuvi relaxed quviurl videourl file = do
tmp <- fromRepo $ gitAnnexTmpObjectLocation key
showOutput
ok <- Transfer.notifyTransfer Transfer.Download (Just file) $
Transfer.download webUUID key (Just file) Transfer.forwardRetry Transfer.noObserver $ const $ do
Transfer.download webUUID key (Just file) Transfer.forwardRetry Transfer.noObserver $ \p -> do
liftIO $ createDirectoryIfMissing True (parentDir tmp)
downloadUrl [videourl] tmp
downloadUrl key p [videourl] tmp
if ok
then do
cleanup webUUID quviurl file key (Just tmp)
@ -294,9 +294,9 @@ addUrlFile relaxed url urlinfo file = do
downloadWeb :: URLString -> Url.UrlInfo -> FilePath -> Annex (Maybe Key)
downloadWeb url urlinfo file = do
let dummykey = addSizeUrlKey urlinfo $ Backend.URL.fromUrl url Nothing
let downloader f _ = do
let downloader f p = do
showOutput
downloadUrl [url] f
downloadUrl dummykey p [url] f
showAction $ "downloading " ++ url ++ " "
downloadWith downloader dummykey webUUID url file