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"
msgid "Backup started with unknown mode"
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]
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
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.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)
elif(mode == self.Restore and self.restore_point is not None and self.remote_vfs.root_path != ''):
if(self.restore_point.split('.')[-1] != 'zip'):

View File

@ -50,6 +50,17 @@
</constraints>
<control type="spinner" format="string" />
</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 id="2" label="">
<!-- verbose logging -->