don't show "unknown" as the percent complete for transferinfo with no bytesComplete value
This commit is contained in:
parent
1296cfb09a
commit
19e8f1ca0e
1 changed files with 2 additions and 3 deletions
|
@ -61,9 +61,8 @@ readLcDirection "download" = Just Download
|
||||||
readLcDirection _ = Nothing
|
readLcDirection _ = Nothing
|
||||||
|
|
||||||
percentComplete :: Transfer -> TransferInfo -> Maybe Percentage
|
percentComplete :: Transfer -> TransferInfo -> Maybe Percentage
|
||||||
percentComplete (Transfer { transferKey = key }) (TransferInfo { bytesComplete = Just complete }) =
|
percentComplete (Transfer { transferKey = key }) info =
|
||||||
(\size -> percentage size complete) <$> keySize key
|
percentage <$> keySize key <*> Just (fromMaybe 0 $ bytesComplete info)
|
||||||
percentComplete _ _ = Nothing
|
|
||||||
|
|
||||||
upload :: UUID -> Key -> AssociatedFile -> Annex Bool -> Annex Bool
|
upload :: UUID -> Key -> AssociatedFile -> Annex Bool -> Annex Bool
|
||||||
upload u key file a = runTransfer (Transfer Upload u key) file a
|
upload u key file a = runTransfer (Transfer Upload u key) file a
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue