aboutsummaryrefslogtreecommitdiff
path: root/Logs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-01-19 15:55:32 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-01-19 15:55:32 -0400
commit312d8657a68c67711491e807382a38371bfb418e (patch)
tree3da39cc605b02fc551dbcd88f66ef1994435f5de /Logs
parentfccc38249549e7471bceb4e9859e3beb2642217d (diff)
refactor
Diffstat (limited to 'Logs')
-rw-r--r--Logs/Web.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/Logs/Web.hs b/Logs/Web.hs
index 6c1e6d135..8e737893e 100644
--- a/Logs/Web.hs
+++ b/Logs/Web.hs
@@ -15,6 +15,7 @@ module Logs.Web (
Downloader(..),
getDownloader,
setDownloader,
+ setDownloader',
setTempUrl,
removeTempUrl,
) where
@@ -32,6 +33,8 @@ import Annex.CatFile
import qualified Git
import qualified Git.LsFiles
import Utility.Url
+import Annex.UUID
+import qualified Types.Remote as Remote
{- Gets all urls that a key might be available from. -}
getUrls :: Key -> Annex [URLString]
@@ -108,6 +111,11 @@ setDownloader u WebDownloader = u
setDownloader u QuviDownloader = "quvi:" ++ u
setDownloader u OtherDownloader = ":" ++ u
+setDownloader' :: URLString -> Remote -> String
+setDownloader' u r
+ | Remote.uuid r == webUUID = setDownloader u WebDownloader
+ | otherwise = setDownloader u OtherDownloader
+
getDownloader :: URLString -> (URLString, Downloader)
getDownloader u = case separate (== ':') u of
("quvi", u') -> (u', QuviDownloader)