mirror of
https://github.com/robweber/xbmcbackup.git
synced 2024-12-22 14:05:23 +01:00
Added verbose logging setting
modified vfs.py to filter out compressed files that xbmc treats as directories by default
This commit is contained in:
parent
acb1bb2de3
commit
7b582072bd
@ -8,7 +8,8 @@ class FileManager:
|
||||
walk_path = ''
|
||||
addonDir = ''
|
||||
fileArray = None
|
||||
|
||||
verbose_log = False
|
||||
|
||||
def __init__(self,path,addon_dir):
|
||||
self.walk_path = path
|
||||
self.addonDir = addon_dir
|
||||
@ -19,7 +20,8 @@ class FileManager:
|
||||
|
||||
def createFileList(self,Addon):
|
||||
self.fileArray = []
|
||||
|
||||
self.verbose_log = Addon.getSetting("verbose_log") == 'true'
|
||||
|
||||
#figure out which syncing options to run
|
||||
if(Addon.getSetting('backup_addons') == 'true'):
|
||||
self.addFile("-addons")
|
||||
@ -69,6 +71,8 @@ class FileManager:
|
||||
|
||||
def addFile(self,filename):
|
||||
#write the full remote path name of this file
|
||||
if(self.verbose_log):
|
||||
xbmc.log("Add File: " + filename)
|
||||
self.fileArray.append(filename)
|
||||
|
||||
def getFileList(self):
|
||||
|
@ -10,6 +10,7 @@
|
||||
<string id="30023">Mode</string>
|
||||
<string id="30024">Type Remote Path</string>
|
||||
<string id="30025">Remote Path Type</string>
|
||||
<string id="30026">Verbose Logging</string>
|
||||
|
||||
<string id="30030">User Addons</string>
|
||||
<string id="30031">Addon Data</string>
|
||||
|
@ -38,6 +38,8 @@ def walk(path):
|
||||
|
||||
current_depth = 0
|
||||
|
||||
not_dir = ['.zip','.xsp','.rar']
|
||||
|
||||
while True:
|
||||
|
||||
if current_depth > -1:
|
||||
@ -48,8 +50,10 @@ def walk(path):
|
||||
current_dirs, current_files = [], []
|
||||
|
||||
for x in listdir(current_path, extra_metadata=True):
|
||||
|
||||
file_ext = x['file'].split('.')[-1]
|
||||
|
||||
if x['filetype'] == 'directory' and not x['file'].startswith("zip://"):
|
||||
if x['filetype'] == 'directory' and not any(file_ext in s for s in not_dir):
|
||||
|
||||
current_dirs.append(urllib.unquote(x['file']))
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
<setting id="remote_path" type="folder" label="30020" visible="eq(-2,0)" />
|
||||
<setting id="backup_name" type="text" label="30021" default="xbmc_backup"/>
|
||||
<setting id="run_silent" type="bool" label="30022" default="false" />
|
||||
<setting id="verbose_log" type="bool" label="30026" default="false" />
|
||||
</category>
|
||||
<category id="selection" label="30012">
|
||||
<setting id="backup_addons" type="bool" label="30030" default="true" />
|
||||
|
Loading…
Reference in New Issue
Block a user