summaryrefslogtreecommitdiff
path: root/Logs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-08-28 14:31:30 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-08-28 14:31:30 -0400
commit19e8f1ca0e0b55910bf85fbbae72997618e4d2be (patch)
tree5c16e724cd6249410d7eae8b0e9ce3af5b9e5dc9 /Logs
parent1296cfb09a763878e7b9376f59aabf60fb8d7314 (diff)
don't show "unknown" as the percent complete for transferinfo with no bytesComplete value
Diffstat (limited to 'Logs')
-rw-r--r--Logs/Transfer.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/Logs/Transfer.hs b/Logs/Transfer.hs
index b8938ee69..46ca98403 100644
--- a/Logs/Transfer.hs
+++ b/Logs/Transfer.hs
@@ -61,9 +61,8 @@ readLcDirection "download" = Just Download
readLcDirection _ = Nothing
percentComplete :: Transfer -> TransferInfo -> Maybe Percentage
-percentComplete (Transfer { transferKey = key }) (TransferInfo { bytesComplete = Just complete }) =
- (\size -> percentage size complete) <$> keySize key
-percentComplete _ _ = Nothing
+percentComplete (Transfer { transferKey = key }) info =
+ percentage <$> keySize key <*> Just (fromMaybe 0 $ bytesComplete info)
upload :: UUID -> Key -> AssociatedFile -> Annex Bool -> Annex Bool
upload u key file a = runTransfer (Transfer Upload u key) file a