         callback() if callback
       )
 
+  preSync: ->
+    deferred = new $.Deferred()
+
+    if Sync.oauth.service is "skydrive"
+      $.ajax(
+        Sync.generateRequest
+          request: "findappdir"
+      ).done((data) ->
+        for item in data.data
+          # Break when we find the springseed folder
+          if item.name.toLowerCase() is "springseed"
+            Sync.syncMeta.folderid = item.id
+            break
+        $.ajax(
+          Sync.generateRequest
+            request: "listappdir"
+        ).done((data) ->
+          Sync.syncMeta.map = {}
+          for item in data.data
+            Sync.syncMeta.map[item.name] = item.id
+          deferred.resolve()
+        )
+      )
+    else
+      deferred.resolve()
+
+    return deferred.promise()
+
   # The main syncing function.
   # It downloads the meta, then updates it to latest version as well as doing various other io.
   # It's magic. Trust me.
   doSync: ->
+
+    console.log("bosh")
 
     # Downloads a meta file.
     $.ajax(

            Sync.queue = {"Note": {}, "Notebook": {}}
            Sync.saveQueue()

  generateRequest: (opts) ->
    if Sync.oauth.service is "dropbox"
      params =

        beforeSend: (xhr) ->
          xhr.setRequestHeader "Authorization", "Bearer " + Sync.oauth.access_token

      if opts.request is "me"
        params.type = "get"
        params.url = "https://api.dropbox.com/1/account/info"

      else if opts.request is "download"
        params.type = "get"
        params.url = "https://api-content.dropbox.com/1/files/sandbox/" + opts.filename + ".seed"

