diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-03-10 13:12:24 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-03-10 13:35:31 -0400 |
commit | 8cb9381befed4174624edfc80e09185c9340b4f6 (patch) | |
tree | e5d2041ff38502b1f8a5ef9caa6515cccfcea555 /Command/Info.hs | |
parent | e230fd58b5f5d5d16f87e1bd5c0f2e553f2ae5a2 (diff) |
AssociatedFile newtype
To prevent any further mistakes like 1a497cefb47557f0b4788c606f9071be422b2511
This commit was sponsored by Francois Marier on Patreon.
Diffstat (limited to 'Command/Info.hs')
-rw-r--r-- | Command/Info.hs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Command/Info.hs b/Command/Info.hs index aaee08fe1..0867bf8ea 100644 --- a/Command/Info.hs +++ b/Command/Info.hs @@ -39,6 +39,7 @@ import Logs.Transfer import Types.Key import Types.TrustLevel import Types.FileMatcher +import Types.ActionItem import qualified Limit import Messages.JSON (DualDisp(..), ObjectMap(..)) import Annex.BloomFilter @@ -420,7 +421,9 @@ transfer_list = stat desc $ nojson $ lift $ do desc = "transfers in progress" line uuidmap t i = unwords [ formatDirection (transferDirection t) ++ "ing" - , fromMaybe (key2file $ transferKey t) (associatedFile i) + , actionItemDesc + (ActionItemAssociatedFile (associatedFile i)) + (transferKey t) , if transferDirection t == Upload then "to" else "from" , maybe (fromUUID $ transferUUID t) Remote.name $ M.lookup (transferUUID t) uuidmap @@ -428,9 +431,11 @@ transfer_list = stat desc $ nojson $ lift $ do jsonify t i = object $ map (\(k, v) -> (T.pack k, v)) $ [ ("transfer", toJSON (formatDirection (transferDirection t))) , ("key", toJSON (key2file (transferKey t))) - , ("file", toJSON (associatedFile i)) + , ("file", toJSON afile) , ("remote", toJSON (fromUUID (transferUUID t))) ] + where + AssociatedFile afile = associatedFile i disk_size :: Stat disk_size = simpleStat "available local disk space" $ |