add support for readonly remotes

Currently only the web special remote is readonly, but it'd be possible to
also have readonly drives, or other remotes. These are handled in the
assistant by only downloading from them, and never trying to upload to
them.
This commit is contained in:
Joey Hess 2012-08-26 15:39:02 -04:00
parent 4d269db520
commit 271ea49978
13 changed files with 33 additions and 9 deletions

View file

@ -23,6 +23,7 @@ import Assistant.DaemonStatus
import Logs.Transfer
import Types.Remote
import qualified Remote
import qualified Types.Remote as Remote
import Control.Concurrent.STM
import qualified Data.Map as M
@ -78,7 +79,7 @@ queueTransfers schedule q dstatus k f direction = do
-- can be uploaded to, in order to ensure all
-- remotes can access the content. Currently,
-- send to every remote we can.
| otherwise = return rs
| otherwise = return $ filter (not . Remote.readonly) rs
gentransfer r = Transfer
{ transferDirection = direction
, transferKey = k