This commit is contained in:
Rob Weber 2023-04-05 11:21:09 -05:00
parent d4240f1345
commit 4c4e4a74ab
3 changed files with 21 additions and 2 deletions

View File

@ -621,3 +621,11 @@ msgstr ""
msgctxt "#30159" msgctxt "#30159"
msgid "Backup started with unknown mode" msgid "Backup started with unknown mode"
msgstr "" msgstr ""
msgctxt "#30160"
msgid "Backup Filename Suffix"
msgstr ""
msgctxt "#30161"
msgid "Amend a string to the end of each backup folder or ZIP file"
msgstr ""

View File

@ -93,7 +93,7 @@ class XbmcBackup:
file_ext = aFile.split('.')[-1] file_ext = aFile.split('.')[-1]
folderName = aFile.split('.')[0] folderName = aFile.split('.')[0]
if(file_ext == 'zip' and len(folderName) == 12 and folderName.isdigit()): if(file_ext == 'zip' and len(folderName) >= 12 and folderName[0:12].isdigit()):
# format the name according to regional settings and display the file size # format the name according to regional settings and display the file size
folderName = "%s - %s" % (self._dateFormat(folderName), utils.diskString(self.remote_vfs.fileSize(self.remote_base_path + aFile))) folderName = "%s - %s" % (self._dateFormat(folderName), utils.diskString(self.remote_vfs.fileSize(self.remote_base_path + aFile)))
@ -368,7 +368,7 @@ class XbmcBackup:
self.saved_remote_vfs = self.remote_vfs self.saved_remote_vfs = self.remote_vfs
self.remote_vfs = ZipFileSystem(zip_path, "w") self.remote_vfs = ZipFileSystem(zip_path, "w")
self.remote_vfs.set_root(self.remote_vfs.root_path + time.strftime("%Y%m%d%H%M") + "/") self.remote_vfs.set_root(self.remote_vfs.root_path + time.strftime("%Y%m%d%H%M") + utils.getSetting('backup_suffix').strip() + "/")
progressBarTitle = progressBarTitle + utils.getString(30023) + ": " + utils.getString(30016) progressBarTitle = progressBarTitle + utils.getString(30023) + ": " + utils.getString(30016)
elif(mode == self.Restore and self.restore_point is not None and self.remote_vfs.root_path != ''): elif(mode == self.Restore and self.restore_point is not None and self.remote_vfs.root_path != ''):
if(self.restore_point.split('.')[-1] != 'zip'): if(self.restore_point.split('.')[-1] != 'zip'):

View File

@ -50,6 +50,17 @@
</constraints> </constraints>
<control type="spinner" format="string" /> <control type="spinner" format="string" />
</setting> </setting>
<!-- backup suffix -->
<setting id="backup_suffix" type="string" label="30160" help="30161">
<level>2</level>
<default></default>
<constraints>
<allowempty>true</allowempty>
</constraints>
<control type="edit" format="string">
<heading>30024</heading>
</control>
</setting>
</group> </group>
<group id="2" label=""> <group id="2" label="">
<!-- verbose logging --> <!-- verbose logging -->