aboutsummaryrefslogtreecommitdiff
path: root/Annex/Transfer.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-11-29 15:49:05 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-11-29 16:40:32 -0400
commit3b3f7512f6d0b91de21f6fcc4aba8897174bc4a8 (patch)
tree44c85fda3d6a35d62b00cca26bf6acaf474133c2 /Annex/Transfer.hs
parentb7178922644c813a2cb69c185ca751aa234fa05b (diff)
youtube-dl working
Including resuming and cleanup of incomplete downloads. Still todo: --fast, --relaxed, importfeed, disk reserve checking, quvi code cleanup. This commit was sponsored by Anthony DeRobertis on Patreon.
Diffstat (limited to 'Annex/Transfer.hs')
-rw-r--r--Annex/Transfer.hs20
1 files changed, 1 insertions, 19 deletions
diff --git a/Annex/Transfer.hs b/Annex/Transfer.hs
index 3fcf1a1b9..ccb5409a7 100644
--- a/Annex/Transfer.hs
+++ b/Annex/Transfer.hs
@@ -5,7 +5,7 @@
- Licensed under the GNU GPL version 3 or higher.
-}
-{-# LANGUAGE CPP, FlexibleInstances, BangPatterns #-}
+{-# LANGUAGE CPP, BangPatterns #-}
module Annex.Transfer (
module X,
@@ -27,7 +27,6 @@ import Annex.Perms
import Utility.Metered
import Annex.LockPool
import Types.Key
-import Types.Remote (Verification(..))
import qualified Types.Remote as Remote
import Types.Concurrency
@@ -35,23 +34,6 @@ import Control.Concurrent
import qualified Data.Map.Strict as M
import Data.Ord
-class Observable a where
- observeBool :: a -> Bool
- observeFailure :: a
-
-instance Observable Bool where
- observeBool = id
- observeFailure = False
-
-instance Observable (Bool, Verification) where
- observeBool = fst
- observeFailure = (False, UnVerified)
-
-instance Observable (Either e Bool) where
- observeBool (Left _) = False
- observeBool (Right b) = b
- observeFailure = Right False
-
upload :: Observable v => UUID -> Key -> AssociatedFile -> RetryDecider -> (MeterUpdate -> Annex v) -> NotifyWitness -> Annex v
upload u key f d a _witness = guardHaveUUID u $
runTransfer (Transfer Upload u key) f d a