mirror of
https://github.com/robweber/xbmcbackup.git
synced 2024-11-15 04:45:49 +01:00
fixes #39
This commit is contained in:
parent
25a9faed9a
commit
d28596728b
@ -1,5 +1,7 @@
|
|||||||
Version 0.4.3
|
Version 0.4.3
|
||||||
|
|
||||||
|
added error message if remote directory is blank
|
||||||
|
|
||||||
added license tag
|
added license tag
|
||||||
|
|
||||||
Version 0.4.2
|
Version 0.4.2
|
||||||
|
@ -20,6 +20,8 @@ if(mode != -1):
|
|||||||
#run the profile backup
|
#run the profile backup
|
||||||
backup = XbmcBackup()
|
backup = XbmcBackup()
|
||||||
|
|
||||||
|
if(backup.remoteConfigured()):
|
||||||
|
|
||||||
if(mode == backup.Restore):
|
if(mode == backup.Restore):
|
||||||
#allow user to select the backup to restore from
|
#allow user to select the backup to restore from
|
||||||
restorePoints = backup.listBackups()
|
restorePoints = backup.listBackups()
|
||||||
@ -30,3 +32,7 @@ if(mode != -1):
|
|||||||
backup.selectRestore(restorePoints[selectedRestore])
|
backup.selectRestore(restorePoints[selectedRestore])
|
||||||
|
|
||||||
backup.run(mode)
|
backup.run(mode)
|
||||||
|
else:
|
||||||
|
#can't go any further
|
||||||
|
xbmcgui.Dialog().ok(utils.getString(30010),utils.getString(30045))
|
||||||
|
utils.openSettings()
|
||||||
|
@ -44,6 +44,14 @@ class XbmcBackup:
|
|||||||
self.remote_base_path = "/"
|
self.remote_base_path = "/"
|
||||||
self.remote_vfs = DropboxFileSystem("/")
|
self.remote_vfs = DropboxFileSystem("/")
|
||||||
|
|
||||||
|
def remoteConfigured(self):
|
||||||
|
result = True
|
||||||
|
|
||||||
|
if(self.remote_base_path == ""):
|
||||||
|
result = False
|
||||||
|
|
||||||
|
return result
|
||||||
|
|
||||||
def listBackups(self):
|
def listBackups(self):
|
||||||
result = []
|
result = []
|
||||||
|
|
||||||
|
@ -10,6 +10,9 @@ def data_dir():
|
|||||||
def addon_dir():
|
def addon_dir():
|
||||||
return __Addon.getAddonInfo('path')
|
return __Addon.getAddonInfo('path')
|
||||||
|
|
||||||
|
def openSettings():
|
||||||
|
__Addon.openSettings()
|
||||||
|
|
||||||
def log(message,loglevel=xbmc.LOGNOTICE):
|
def log(message,loglevel=xbmc.LOGNOTICE):
|
||||||
xbmc.log(encode(__addon_id__ + ": " + message),level=loglevel)
|
xbmc.log(encode(__addon_id__ + ": " + message),level=loglevel)
|
||||||
|
|
||||||
|
@ -50,6 +50,8 @@ class BackupScheduler:
|
|||||||
utils.showNotification(utils.getString(30053))
|
utils.showNotification(utils.getString(30053))
|
||||||
#run the job in backup mode, hiding the dialog box
|
#run the job in backup mode, hiding the dialog box
|
||||||
backup = XbmcBackup()
|
backup = XbmcBackup()
|
||||||
|
|
||||||
|
if(backup.remoteConfigured()):
|
||||||
backup.run(XbmcBackup.Backup,True)
|
backup.run(XbmcBackup.Backup,True)
|
||||||
|
|
||||||
#check if this is a "one-off"
|
#check if this is a "one-off"
|
||||||
@ -57,6 +59,8 @@ class BackupScheduler:
|
|||||||
#disable the scheduler after this run
|
#disable the scheduler after this run
|
||||||
self.enabled = "false"
|
self.enabled = "false"
|
||||||
utils.setSetting('enable_scheduler','false')
|
utils.setSetting('enable_scheduler','false')
|
||||||
|
else:
|
||||||
|
utils.showNotification(utils.getString(30045))
|
||||||
|
|
||||||
#check if we should shut the computer down
|
#check if we should shut the computer down
|
||||||
if(utils.getSetting("cron_shutdown") == 'true'):
|
if(utils.getSetting("cron_shutdown") == 'true'):
|
||||||
@ -81,7 +85,7 @@ class BackupScheduler:
|
|||||||
|
|
||||||
if(new_run_time != self.next_run):
|
if(new_run_time != self.next_run):
|
||||||
self.next_run = new_run_time
|
self.next_run = new_run_time
|
||||||
utils.showNotification(utils.getString(30080) + " " + datetime.datetime.fromtimestamp(self.next_run).strftime('%m-%d-%Y %H:%M'))
|
utils.showNotification(utils.getString(30081) + " " + datetime.datetime.fromtimestamp(self.next_run).strftime('%m-%d-%Y %H:%M'))
|
||||||
utils.log("scheduler will run again on " + datetime.datetime.fromtimestamp(self.next_run).strftime('%m-%d-%Y %H:%M'))
|
utils.log("scheduler will run again on " + datetime.datetime.fromtimestamp(self.next_run).strftime('%m-%d-%Y %H:%M'))
|
||||||
|
|
||||||
def settingsChanged(self):
|
def settingsChanged(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user