download :: RemoteFile -> FilePath -> ApiAction File
download (RemoteFile file _ document) targetFile = do
    (manager, aToken, _, _) <- ask
    liftResourceT $ downloadDocument aToken manager targetFile document
    liftIO $ debugM "Sync.download" ("Downloaded " ++ targetFile)
    newFileModified <- liftIO $ getModificationTime targetFile
    return $ File (File.path file) newFileModified
download :: RemoteFile -> FilePath -> ApiAction File
download (RemoteFile file _ document) targetFile = do
    (manager, aToken, _, _) <- ask
    liftResourceT $ downloadDocument aToken manager targetFile document
    liftIO $ debugM "Sync.download" ("Downloaded " ++ targetFile)
    newFileModified <- liftIO $ getModificationTime targetFile
    return $ File (File.path file) newFileModified
download (RemoteFile file _ document) targetFile = do
    (manager, aToken, _, _) <- ask
    liftResourceT $ downloadDocument aToken manager targetFile document
    liftIO $ debugM "Sync.download" ("Downloaded " ++ targetFile)
    newFileModified <- liftIO $ getModificationTime targetFile
    return $ File (File.path file) newFileModified