diff --git a/resources/lib/backup.py b/resources/lib/backup.py index a66b531..edb5133 100644 --- a/resources/lib/backup.py +++ b/resources/lib/backup.py @@ -1,10 +1,14 @@ import xbmc import xbmcgui import xbmcvfs +from resources.dropbox import client, rest, session import utils as utils import os import time +APP_KEY = 'f5wlmek6aoriqax' +APP_SECRET = 'b1461sje1kxgzet' + class FileManager: walk_path = '' fileArray = None @@ -127,7 +131,13 @@ class XbmcBackup: #append backup folder name if(mode == self.Backup and self.remote_root != ''): - self.remote_path = self.remote_root + time.strftime("%Y%m%d") + "/" + #check here if we're using Dropbox or not + if(utils.getSetting('remote_selection') == 2): + session = session.DropboxSession(APP_KEY,APP_SECRET,"app_folder") + token = session.obtain_request_token() + access_token = session.obtain_access_token(token) + else: + self.remote_path = self.remote_root + time.strftime("%Y%m%d") + "/" elif(mode == self.Restore and utils.getSetting("backup_name") != '' and self.remote_root != ''): self.remote_path = self.remote_root + utils.getSetting("backup_name") + "/" else: